This is headed in the right direction I think.
It doesn't take into accound the sub-query I was after.
I know the ID of the class.  I want all classes on the same day as the ID
'd
class.
Each class date has DATE and TIME info in the same field.  Your approach
gets around that limitation but I'm not sure how to do the syntax for the
sub-query.  I could do it in two queries I guess, but that isn't very
elegant.  One to first find the date of the class the specified ID is on,
then insert that into the "mydatefield" of the second query in your synta
x.

Any way to do it in one query?

Bruce

----- Original Message -----
From: "Bud" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, February 06, 2002 2:58 PM
Subject: Re: Formatting a Date in MS SQL Access Query...Try Again


> On 2/6/02, Bruce Holm penned:
> >You missed some key info I mentioned.  Access stores dates as date and
 ti
> >me
> >(1/6/2002 1:57:00 PM).
> >In my table are classes for the same day, but at different times.
> >What I want my query to find (and maybe what wasn't clear) is all clas
ses
> >for a given date (just the date part, not the time, otherwise it will 
ret
> >urn
> >just one class matching the date and time) where the id for one of the
> >classes is "ClassSel" (the id of the class the user has specified from
 a
> >pull down menu.)
> >What I need is to determine the DATE portion of the field, ignoring th
e T
> >IME
> >portion of the same field.
>
> This should work:
>
> WHERE mydatefield >= #CreateODBCDate(mydate)#
> and mydatefield < #CreateODBCDate(DateAdd('D', 1, mydate))#
>
> This is assuming looking for a single date (mydate) and not a range
> and looks for a date/time value of midnight or later on mydate and
> earlier than midnight on the day after mydate. Or basically between
> 12:00:00 AM and 11:59:59 PM on the date entered.
>
> You can change the value of mydate in the dateadd function to a 2nd dat
e.
> --
>
> Bud Schneehagen - Tropical Web Creations
>
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> ColdFusion Solutions / eCommerce Development
> [EMAIL PROTECTED]
> http://www.twcreations.com/
> 
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to