House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

date and time from two different inputs query a single datetime field

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Les Mizzell
05/10/2012 09:50 PM

<cfinput type="text" name="xdate_use" > ex: 05/31/2012 <cfinput type="text" name="xtime" > ex: 3:31 PM Given the values used as examples for the fields above, exactly how would I go about querying a datetime stamp field (SQL Server) to find all records dates on or after the date/time above? No problem doing it with just the date:    responsedate >= <cfqueryparam value="#trim(form.xdate)#" cfsqltype="CF_SQL_DATE" />   but for the life of me, I can't figure how to put both fields together to do date AND time... I'm probably an idiot..

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
andy matthews
05/10/2012 10:05 PM

Give the fields the same name. In most languages that results in a commadelimited value which you could then strip out. You could also just concatenate them together in your queryparam: <cfqueryparam value="#trim(form.xdate_use)##trim(form.xtime)#"   cfsqltype="CF_SQL_DATE" /> field <cfinput type="text" name="xdate_use" > ex: 05/31/2012 <cfinput type="text" name="xtime" > ex: 3:31 PM Given the values used as examples for the fields above, exactly how would I go about querying a datetime stamp field (SQL Server) to find all records dates on or after the date/time above? No problem doing it with just the date:    responsedate >= <cfqueryparam value="#trim(form.xdate)#" cfsqltype="CF_SQL_DATE" />   but for the life of me, I can't figure how to put both fields together to do date AND time... I'm probably an idiot..

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bobby
05/10/2012 10:13 PM

#createOBDCDateTime(form.xdate_use & ' ' & form.xtime)# On 5/10/12 9:50 PM, "Les Mizzell" <lesmizz@bellsouth.net> wrote: ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 21, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference