sql server - Date Picker format vs Database timestamp -


is possible compare 2 dates if formatted in different ways? 1 date coming coldfusion ui input in following format:

mm/dd/yyyy  

my timestamp in mssql database in following format:

yyyy/mm/dd 

background: need write query compares dates , returns rows timestamp after user selected date. need reformat either date?

example:

<cfset start_date = 'form.sdate'>  <cfquery name="sortdate" datasource="rc"> select * my_db_table submission_date > #start_date# </cfquery> 

first off, always use cfqueryparam in queries when dynamically including content. second, should able use start_date "as is" compare date date in database

so, like:

<cfquery name="sortdate" datasource="rc">     select *     my_db_table     submission_date > <cfqueryparam value="#start_date#" cfsqltype="cf_sql_date"> </cfquery> 

last, can test raw sql in mssql management studio test date comparison.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -