Right, Glen, it is highly DB specific, but it may be a good approach versus
storing the date separately and/or redundantly.
In fact, I was planning to write the same note Terry did, but I was trying
to get a real example. I'd offer a SQL Server example but I'd just lost my
system recently and have not yet reinstalled SQL Server. But for Access,
this works (and may therefore work for SQL Server):
SELECT format(mytimestamp,'yyyy-mm-dd') as dateonly
FROM ...
I don't know how performance-efficient that is (does it use index values for
the date, if they exist?), but it does do the trick. I know SQL Server
offers a DatePart with a "ddddd" option that may be worth trying. That
doesn't work in Access (the best you can do is a series of single DatePart
values for m, d, and yyyy.
/charlie
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Glenn Shukster
Sent: Thursday, February 28, 2002 12:58 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFTALKTor] Storing time as a separate value
Depends on the database if that funcationality is easily available.
[EMAIL PROTECTED] wrote:
>
> You can do a group by on a computed field, therefore you can use the
> date() function to extract the date from the timestamp field:
>
> select date(mytimestamp) as mytimestamps_date
> from ...
> group by mytimestamps_date
>
> My syntax may be slightly wrong, I have not implemented this anywhere, but
> I believe the reasoning to be sound.
>
> Terry
>
> On Thu, 28 Feb 2002, Dimitri Abramov wrote:
>
> > Good point!
> >
> > Dimitri
> >
> > -----Original Message-----
> > From: Glenn Shukster [mailto:[EMAIL PROTECTED]]
> > Sent: February 28, 2002 12:25 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [CFTALKTor] Storing time as a separate value
> >
> >
> > If you are ever doing a group by query then you can do it by date. With
> > datetime its not worth doing a group by.
> >
> > Dimitri Abramov wrote:
> > >
> > > We have a database that stores date and time as separate values in
> > different
> > > fields. I am wondering when it could be useful? I used to store
datetime
> > in
> > > one field as a result of 'now()' function.
> > > It takes less space (I think) and easer to compare.
> > >
> > > Thanks,
> > > Dimitri
> > > -
> > > You are subscribed to the CFUGToronto CFTALK ListSRV.
> > > This message has been posted by: Dimitri Abramov
> > <[EMAIL PROTECTED]>
> > > To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> > > Manager: Kevin Towes ([EMAIL PROTECTED])
> > http://www.CFUGToronto.org/
> > > This System has been donated by Infopreneur, Inc.
> > > (http://www.infopreneur.net)
> >
> >
>
> --
> Terry Fielder
> Network Engineer
> Great Gulf Homes / Ashton Woods Homes
>
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: [EMAIL PROTECTED]
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED])
http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
--
Cheers
Glenn Shukster (Logic Fundamentals Inc.) Thornhill, Ont. Canada
Phone:(905)771-6458 Fax:(905)771-6819 www.logicfundamentals.com
President of TDUG www.tdug.com
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: Glenn Shukster <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "charles arehart" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)