Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
ccnorris #1
Start and end date of month
I am trying to calculate the start and end dates for a month. I am using the
formulas:
<cfset first_of_month =
#CreateODBCDate(CreateDate(Year(Now()),Month(Now() ),1))#>
<cfset last_of_month =
#CreateODBCDate(CreateDate(Year(Now()),Month(Now() ),DaysInMonth(Now())))#>
When I try to insert the data into the database I get the following error
message:
"ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression ''{d '2005-07-01'}''."
Any help with this will be much appreciated!
ccnorris Guest
-
Query distinct month and date
ASP 3.0 VB - access We are trying to take a date field and pull the month and year into a drop down menu. I am using access and can format the... -
SQL: can a date ONLY contain month/year info?
When using a SQL datetime field, is there a way to store ONLY the month and year? I have a situation where I need to store both month/year and... -
2 digit Date and month format
Hi, select @month_part = datepart(mm,@mdate) select @year_part = datepart(yyyy,@mdate) How do I get '01' for January sqlserver returns 1 for... -
Last Date of previous month
List , I want to obtain the Last Date of previous Month ie 09/30/2003 ,if report is run in Oct . and 10/31/2003 when report is run in Nov. I... -
selecting based on a month in a date
Hi, Asked this on the mySQL list but it seems to be more of a PHP syntax thing that a mySQL thing. In have the following line in PHP <?php... -
-
ccnorris #3
Re: Start and end date of month
Sure. This is only part of it. I am just using this part for now to test the
new field names.
<cfquery name="newdata2" datasource="DBSales">
INSERT INTO moinprogress(month_num,
first_of_month,
last_of_month,
1)
VALUES('#month_num#',
'#first_of_month#',
'#last_of_month#',
'#DTOTAL#')
</cfquery>
ccnorris Guest
-
mxstu #4
Re: Start and end date of month
Just get rid of the single quotes around the date variables:
<cfquery name="newdata2" datasource="DBSales">
INSERT INTO moinprogress(month_num,
first_of_month,
last_of_month,
1)
VALUES('#month_num#',
'#first_of_month#',
'#last_of_month#',
'#DTOTAL#')
</cfquery>
mxstu Guest
-
ccnorris #5
Re: Start and end date of month
Thanks! I should have tried that. I was making it harder than it really was. Thanks again!!
ccnorris Guest



Reply With Quote

