I am trying to generate a ODBC date so I can conditionally run a query based off the 1st of the year.
But I am having a strange issue.
Here is what I have and it works:
<cfset today = CreateODBCDate(Now())>
<CFSET sinceThe1st = CreateDateTime(#year(today)#, #month(monthCurrentPast)#, #Day(FirstDayOfMonth(Now()))#, #hour(today)#, #minute(today)#, #second(today)#)>
<!--- WARNING: when you place a 1 in for month(1) below it thinks it is December --->
<CFSET sinceThe1stOfTheYear = CreateDateTime(#year(today)#, #month(12)#, #Day(FirstDayOfMonth(Now()))#, #hour(today)#, #minute(today)#, #second(today)#)>
But when I change the month(1) I get an output of December instead of January.
But I am having a strange issue.
Here is what I have and it works:
<cfset today = CreateODBCDate(Now())>
<CFSET sinceThe1st = CreateDateTime(#year(today)#, #month(monthCurrentPast)#, #Day(FirstDayOfMonth(Now()))#, #hour(today)#, #minute(today)#, #second(today)#)>
<!--- WARNING: when you place a 1 in for month(1) below it thinks it is December --->
<CFSET sinceThe1stOfTheYear = CreateDateTime(#year(today)#, #month(12)#, #Day(FirstDayOfMonth(Now()))#, #hour(today)#, #minute(today)#, #second(today)#)>
But when I change the month(1) I get an output of December instead of January.