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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Date Conversion

Author  Topic 

afifimk
Starting Member

22 Posts

Posted - 2009-10-08 : 17:44:19
The code below works fine in SQL analyzer. It brings the desired results with the most recent date on top. When I use this code in my ASP pages it does not behave in the same manner, it brings the results back in the natural order. I started to wonder if it has anything to do with date as the database is using DATETIME. Can someone please help in adding a date conversion to this SQL statement and I will test and see what happens. I want to remove the time, assuming this is the correct approach.


SELECT tblArticles.Article_ID, tblArticles.ArticleTitle, tblArticles.Active_Flag, tblArticles.DateUpdated
FROM tblArticles WHERE (tblArticles.ArticleTitle LIKE '%q%') AND (tblArticles.Active_Flag = 'A')
ORDER BY tblArticles.DateUpdated DESC

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-10-09 : 04:11:00
There is nothing to do with date conversion in this query because the data comes from an sql table and not from ASP.
Have a look on how your ASP is sending that query - maybe the DESC or the complete order by is missing.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-09 : 11:42:04
how are you getting this records in asp? are you using recordset?
Go to Top of Page
   

- Advertisement -