Re: SQL Order by Date `Date` column
- From: "Edward Boquette" <uwhat@xxxxxxxxxxxxxx>
- Date: Fri, 01 Apr 2005 18:47:46 GMT
"Al Reid" <areidjr@xxxxxxxxxxxxxxxx> wrote in message
news:O#O11ruNFHA.2604@xxxxxxxxxxxxxxxxxxxxxxx
> "Edward Boquette" <uwhat@xxxxxxxxxxxxxx> wrote in message
news:tog3e.6914311$f47.1268526@xxxxxxxxxxxxxxxxxxxx
> > Hi
> >
> > I am having problems with my SQL in which i want it to return to me all
the
> > records in date order desc.
> >
> > The code i am using now is :-
> >
> > sSQL = "Select * from TABLE1 where comments & followcoms & event_ID like
'%"
> > & Text2.Text & "%' ORDER BY date " & (" ASC")
> >
>
> You stated you wanted them in date order descending, but your SQL shoes
ASC.
>
> > It currently only returns date in the order of e.g
> >
> > 01/01/05
> > 01/02/05
> > 02/01/05
> >
>
> This looks like it is properly ordered (in ascending order)
>
> Jan 1, 2005
> Jan 2, 2005
> Feb 1, 2005
>
> > but i would like the dates returned correctly in order, not by numeric
> > order.
> >
> > Currently the field name in the DB is called date, and formatted to
dd/mm/yy
> > so thats why i cant work this out!
> >
>
> Is it stored in the database as a Date datatype?
>
> perhaps you can try "...ORDER BY CONVERT(char(12), date , 3)" if you are
using MSSQL. In Oracle it would be the TO_CHAR function
> and in MSAccess, I believe you can use the Format function.
>
>
> > Many thanks for your help.
> >
> > Ed
> >
> >
> >
>
Sorry All !!
I know i wrote desc, but i do want ASC as per the code says!!
Any ideas?
Many Thanks !!
.
- Follow-Ups:
- Re: SQL Order by Date `Date` column
- From: Al Reid
- Re: SQL Order by Date `Date` column
- References:
- SQL Order by Date `Date` column
- From: Edward Boquette
- Re: SQL Order by Date `Date` column
- From: Al Reid
- SQL Order by Date `Date` column
- Prev by Date: Re: SQL Order by Date `Date` column
- Next by Date: Re: SQL Order by Date `Date` column
- Previous by thread: Re: SQL Order by Date `Date` column
- Next by thread: Re: SQL Order by Date `Date` column
- Index(es):
Relevant Pages
|