Re: SQL Order by Date `Date` column CAP ATTACHED 32kb
- From: "Stephany Young" <noone@localhost>
- Date: Sun, 3 Apr 2005 00:39:57 +1200
Grrrrrr!
You've missed the point again.
We are not talking about any FORMAT.
We are talking about the DATATYPE.
The FORMAT only has to do with how something is displayed. It has nothing to
do with how it is stored or sorted.
When you open the table in design mode you are present with a grid in which
each field is represent as a row. There are normally 3 columns. The column
on the left has the caption 'Field Name', the column on the right has the
caption 'Description'. The other column has the caption 'Data Type'. That is
one we are interested in. Forget about the panel(s) down the bottom - they
have nothing to do with it.
One of the rows in the grid has 'date' in the 'Field Name' column. If that
row also has 'Date/Time' in the 'Data Type' column then "... order by
[date]" will sort the results the way you want it. If it hasn't then it
won't. It is as simple as that.
Everything you have described indicates that, as another responder said, you
actually have Test that looks like a date, in which case, the sort WILL
cause the results you say you are getting.
The people who responded to your posts do know what they are talking about,
and your apparent obtuseness very likely to be taken as an insult.
"Edward Boquette" <uwhat@xxxxxxxxxxxxxx> wrote in message
news:4gv3e.6990668$f47.1282971@xxxxxxxxxxxxxxxxxxxx
>
> "Stephany Young" <noone@localhost> wrote in message
> news:Ocbgey1NFHA.1500@xxxxxxxxxxxxxxxxxxxxxxx
>> The question that people are really asking you is:
>>
>> What datatype is the [date] column defined as in the actual table in
>> the
>> actual database?
>>
>> If the datatype is Date/Time then "... order by [date]" is the correct
>> SQL
>> syntax to return the recordset in order of [date] ascending.
>>
>> If the datatype is Text then you will have to convert the value to a
>> Date/Time to sort it. With SQL Server you would use " ... order by
>> cast([date] as datetime)". With Jet, if I remember rightly, you can use "
>> order by CDate([date])" but don't quote me on that.
>>
>>
>
> Hi Ya
>
> You had the answer i was looking for yesterday,
> The other piece of sort code i wrote is producing the same results, bit
> like
> i said its fiddly!!!
>
> The datatype in my MS Access DB was in date/time format but still didint
> work when i sorted it, so tried Text and still no good with the normal
> sort
> code.
>
> It was left in text mode last night and worked with my code , and also
> works
> with the code above so will leave it in text mode now !!
>
> Many thanks again
>
> Ed.
>
>
>
>
.
- Follow-Ups:
- Re: SQL Order by Date `Date` column CAP ATTACHED 32kb
- From: Edward Boquette
- Re: SQL Order by Date `Date` column CAP ATTACHED 32kb
- References:
- SQL Order by Date `Date` column
- From: Edward Boquette
- Re: SQL Order by Date `Date` column
- From: Al Reid
- Re: SQL Order by Date `Date` column
- From: Edward Boquette
- Re: SQL Order by Date `Date` column
- From: Al Reid
- Re: SQL Order by Date `Date` column
- From: Edward Boquette
- Re: SQL Order by Date `Date` column
- From: Bob Butler
- Re: SQL Order by Date `Date` column CAP ATTACHED 32kb
- From: Stephany Young
- Re: SQL Order by Date `Date` column CAP ATTACHED 32kb
- From: Edward Boquette
- SQL Order by Date `Date` column
- Prev by Date: Re: SQL Order by Date `Date` column CAP ATTACHED 32kb
- Next by Date: Re: Closing a running MsAccess application
- Previous by thread: Re: SQL Order by Date `Date` column CAP ATTACHED 32kb
- Next by thread: Re: SQL Order by Date `Date` column CAP ATTACHED 32kb
- Index(es):
Relevant Pages
|