Select Distinct Order by...
Hi,
I've tried to order a querry, but it keeps giving me a bug..
Here goes:
*********************CODE************************* ********
Select Distinct right(left(ryCreatedDate,4),2) FROM RYKTE where right(left(ryCreatedDate,6),2) = '03' ORDER BY ryCreatedDate ASC
************************************************** *********
I'm getting this error (From querry analyzer)
*********************Error************************ *********
Server: Msg 145, Level 15, State 1, Line 1
ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
************************************************** *********
I just can't figure it out.. Anybody seen this before?
------------------------
All help is Good help!
Regards
Michael
__________________
------------------------
All help is Good help!
Regards
Michael
|