Ask a Question related to Coldfusion Database Access, Design and Development.
-
DDhillon #1
Outputting data using date field
I have a query that outputs the result based on date. I m writing it as:
select * from apna where assignedto='#form.assignedto#' and
updateddate='#form.thedate#'
The query looks like this with variables:
select * from apna where assignedto='Dave' and updateddate='4-19-2006'
It is showing no result. What am I doing wrong here?
DDhillon Guest
-
Date comparison in a text data field
I have a database column field defined as a text. I store dates in format: dd/mm/yyyy. The user passes a Start date search string in the same... -
Help Outputting data from Access database
I need to outputa grouped set of data from an Access database using CF. Basically a Person can be associated to many positions, programs and... -
Comparing current field data with last entry for field
Hi. I have a form that is inserting sales data on a daily basis. I have a field named "RoundTOTAL" which is the total sales for the day rounded to... -
Converting a text field to a date field - FM6
I need to convert a Text field containing both auto and manually entered dates over to a Date field. The records that were autoentered move over... -
Linking date field to text field entry
Is there a way to setup a date field that will automatically enter the date when any information is entered into a field next to it? -
paross1 #2
Re: Outputting data using date field
A couple of questions.
1. What is your database type?
2. What is the data type of the updateddate column?
3. What is your data souce connection type (ODBC, JDBC, etc.)?
4. What is the version of ColdFusion?
Phil
paross1 Guest
-
DDhillon #3
Re: Outputting data using date field
1. What is your database type?
MS Access
2. What is the data type of the updateddate column?
Date/Time
3. What is your data souce connection type (ODBC, JDBC, etc.)?
ODBC
4. What is the version of ColdFusion?
Coldfusion MX
DDhillon Guest
-
paross1 #4
Re: Outputting data using date field
Try using createodbcdatetime() on your form.thedate variable within the query
to convert it to a date/time object.
select *
from apna
where assignedto='#form.assignedto#'
and updateddate=#createodbcdatetime(form.thedate)#
Phil
paross1 Guest
-
DDhillon #5
Re: Outputting data using date field
Thank you Phill but I m still getting this error:
Error Executing Database Query.
Too few parameters. Expected 1.
The Error Occurred in E:\ApnaCalls\callstrack.cfm: line 40
38 : <td>Size</td>
39 : <td>Date Called</td>
40 : </tr>
41 : <cfoutput query="gettrack">
42 : <tr>
--------------------------------------------------------------------------------
SQL select * from apna where assignedto='Sukh' and updateddate={ts
'2006-04-19 00:00:00'}
DATASOURCE apnacalls
VENDORERRORCODE -3010
SQLSTATE 07002
The way date is stored in database is like : 4/19/2006
Could that be a reason?
DDhillon Guest
-
paross1 #6
Re: Outputting data using date field
I thought that you said that it was a date/time object. What happens if you do
this?
select *
from apna
where assignedto='#form.assignedto#'
and CDate(updateddate) = #createodbcdate(form.thedate)#
Phil
paross1 Guest



Reply With Quote

