bruce,

looks to me like you're overcomplicating your query. if you're trying to 
retrieve records in the classes table where id = #form.classsel# your 
query would be "select * from classes where id = #form.classsel#". i 
don't really understand why you need the date comparison, so maybe i'm 
missing something. btw, you insert odbc access dates like this: "insert 
into classes (classdate) values 
(#createodbcdate(createdate(2002,02,06))#)" and output them like this: 
#dateformat(query_name.classdate,"mmmm d, yyyy")#. 

hth
--dina




----- Original Message ----- 
  From: Bruce Holm 
  To: CF-Talk 
  Sent: Wednesday, February 06, 2002 11:57 AM
  Subject: Formatting a Date in MS SQL Access Query...Try Again


  I'm trying to format a date within a SQL query against an Access 
  database.

  In Oracle you can say TO_DATE(date,mask) but that function doesn't 
exist 

  in Access.   What function is there in Access to do this? 

  Here is the query that doesn't work:

  <cfquery datasource="abb" name="qSelClassInfo">
   SELECT *
   FROM classes
   WHERE TO_DATE(ClassDate,'mm/dd/yy') = TO_DATE((
      SELECT ClassDate FROM classes 
      WHERE id=#Form.ClassSel#),'mm/dd/yy')
  </cfquery>   

  Note that Access stores date and time info in the same field.  So I'm 
  trying to compare just the date portion since several classes can 
occur 
  on the same day.


  -------------------------------------------------
  Bruce Holm - Web Programmer
  Lattice Semiconductor Corp.
  [EMAIL PROTECTED]
  -------------------------------------------------


  
______________________________________________________________________
Get Your Own Dedicated Windows 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=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to