Heya all,
I'm building a calendar that will (in part) will show the user the amount
of time he or she has submitted to the Office Admin for a given date of
the month (hopefully this will make people hate doing timesheets a
little...). I have the calendar itself working without problem, but I'm
caught up in an error while query-ing for the information.
Here's the looping code. The variables "thisyear" and "thismonth" were
set earlier:
============================================================
<CFLOOP INDEX="X" FROM="1" TO="#DaysInMonth(DateOb)#">
<CFSET getfor=CreateDate(thisyear,thismonth,X)>
<cfquery name="getcurrent" datasource="timesheets">
select sum(time) from timesheets as sumtime
where employee_id = #Client.employee_id# and
where submitted = 1 and
where date = #getfor#
</cfquery>
<TD class="listtext"
height="30"><CFOUTPUT>#X#<br>#getcurrent.sumtime#</CFOUTPUT>
</TD>
<CFSET DW=DW + 1>
<CFIF DW EQ 7>
</TR>
<CFSET DW=0>
<CFIF X LT DaysInMonth(DateOb)><TR></CFIF>
</CFIF>
</CFLOOP>
=============================================================
As far as I can tell, the error comes in the "where date =" area. It
looks like it passes the date, but something is killing it. Here's the
error CF Studio gives me:
=============================================================
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator)
in query expression 'employee_id = 1234 and where submitted = 1 and where
date = #5/1/2000 00:00:00#'.
==============================================================
Can I actually do this in a query, in a loop? Or will I have to query
this outside of the loop, then select out the records for the given day,
and I suppose sum them as variables to use in the table...?
James Mathieson
[EMAIL PROTECTED]
Kurtis & Associates, P.C.
2000 M Street, N.W., Suite 600
Washington, D.C. 20036
(202) 328-4500 (voice)
(202) 328-1231 (fax)
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.