Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting a Recordset

Status
Not open for further replies.

bombdropVB

Programmer
Dec 3, 2002
59
GB
Hi all i execute a SP but the Date field due to reasons beyond my control brings backa date as a string, dd/mm/yyyy

now i wish to sort on the date but it only looks at the dd aspect of the date due to the fact its a string

rsAuthors.Sort = "[Year Born], Au_ID DESC"


how can i get round this thanks
 
maybe try something like this...
Code:
rsAuthors.Sort = "Year([Year Born]), Au_ID DESC"

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Sorry no the problem was due to the fact the date is stored as a Varch in the DB i was returning it as a Varchar thus unable to sort correctley as a date. Fixed this by changing the way it is brought back from the SP

CONVERT(datetime,[Year Born] ,103)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top