|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
date and time from two different inputs query a single datetime field
<cfinput type="text" name="xdate_use" > ex: 05/31/2012Les Mizzell 05/10/12 09:50 P Give the fields the same name.andy matthews 05/10/12 10:05 P #createOBDCDateTime(form.xdate_use & ' ' & form.xtime)#Bobby 05/10/12 10:13 P <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.. 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.. #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 -----
|
May 21, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||