Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-12-19 : 09:29:26
|
| Mark writes "Right, i'm a newbie at SQL and asp and i'm having a small problem.Basically I have a list of records showing up from the SQL database (date written is included) and I want a little "new" section to go beside the title when a user (who's previous log in time has been recorded in the SQL database) sees the list and hasn't logged in since they were added.Basically it seems to be an "If time A > time B Then..."... but it doesnt seem to work like that... any ideas?" |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2002-12-19 : 09:44:09
|
| I'd suggest writing a stored procedure to return a column with "*new" when the row is new rather than coding it in ASP.You didn't give any table or query info, but such a query would look like:SELECTCASE WHEN Date1 > Date2 THEN '*new' ELSE '' END AS NewColumn, * -- I've included all your other columns here (my bad). Pick what you want,FROM MyTableWHERE User=@UserPresto change-o - No loops or conditions needed in ASP.Sam |
 |
|
|
lfmn
Posting Yak Master
141 Posts |
Posted - 2002-12-19 : 15:14:38
|
| I would agree 100% with Sam. My current project, which uses ASP and SQL, used to do most of the logic on the ASP side before I was hired. We now do almost all logic on the SQL side and the site runs faster, jumps higher .. oops that's a keds commercial (for you old timers). The point is that it's a far better way to write code.SQL is useful if you don't know cursors :-) |
 |
|
|
|
|
|