No..nothing that simple.
The statement still does not work..

I hate errors like these.

Without the AS AGE thing, the statement works fine, so I know the error
lies with that bit of code.

Any other ideas anyone? 
I am...kinda stumped. And I KNOW this is really simple...I'm just NOT
seeing it.

Went onto something else and came back and I STILL can't see it!

-Gel

-----Original Message-----
From: Angel Stewart [mailto:[EMAIL PROTECTED]]

Hi all,

I know this is really simple and I am just missing something
obvious..but what's the syntax for subtracting two dates in SQL? I tried
creating the Query in MS Access and just copying and pasting the code
into CF...but the code that works in Access throws an error in CF.

Here it is:
--------------------------

<CFQUERY name="results" datasource="modelagency" dbtype="ODBC">

        Select  minfo.appdate, minfo.fname, minfo.lname, minfo.mname,
minfo.gender, minfo.dob, minfo.telhome, minfo.telwork, minfo.telcell,
minfo.pager, minfo.address1, minfo.address2, minfo.occupation,
minfo.agent, minfo.height, minfo.weight, minfo.ethnicity,
minfo.skincolor, minfo.talent, minfo.mexp, minfo.comments,
minfo.modelpic,DateDiff("yyyy",minfo.DOB,NOW()) AS AGE FROM minfo

        WHERE 0 = 0

        <CFIF IsDefined("form.fname") AND #form.fname# NEQ "">

                AND fname LIKE '%#form.fname#%'

        </CFIF>

        <CFIF IsDefined("form.lname") AND #form.lname# NEQ "">

                AND lname LIKE '%#form.lname#%'

        </CFIF>


</CFQUERY>
---------------------------

See the date diff thingy at the end there?

-Gel

______________________________________________________________________
Macromedia ColdFusion 5 Training from the Source
  Step by Step ColdFusion
  http://www.amazon.com/exec/obidos/ASIN/0201758474/houseoffusion

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to