Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26-11-2009
Member
 
Join Date: Jun 2009
Posts: 3,859
Coldfusion query problem

My problem is that my query does not work and I can not find the error. Note that I use coldfusion.

Code:
<cfquery Name="req" datasource="grh_etud15"> 

Select employeeid, full name, employee day 
from employee, intervention 
where employee.employeeid = intervention.employee 
and day = 15/01/2004 

</cfquery>
HTML Code:
<html> 
<body> 

<CFOUTPUT> 

#req.employeeID#
#req.name#
#req.prename#
#req.employee#
#createODBCDate("15/01/2004" )#

</CFOUTPUT>

</body> 
</html>
Reply With Quote
  #2  
Old 26-11-2009
Member
 
Join Date: Nov 2005
Posts: 1,323
Re: Coldfusion query problem

In my opinion it takes atleast quarter date, and to do well even use to_date (or equivalent in your DBMS) with the proper mask, and although many do use a prepared statement.
Reply With Quote
  #3  
Old 26-11-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Coldfusion query problem

Put the date in quotation marks or apostrophes, test the two cases. In all databases, dates are often run as a string in the WHERE clause, and the format to use (DD/MM/YYYY, YYYYMMDD, MM/DD/YYYY) depends on the context. The example given by absolute55 corresponds to Oracle.
Reply With Quote
  #4  
Old 26-11-2009
Member
 
Join Date: Jun 2009
Posts: 3,859
Re: Coldfusion query problem

Yes of course database in access, and coldfusion. I have master system information and so the computer is not my base leg. I always have an error that will be with '' or "" or ##

error message:

Error Executing Database Query.
Data type mismatch in criteria expression.

The error occurred in D:\www\etud15\TD-CF\TD1\exo4.cfm: line 2

1:
2: <cfquery name="req" datasource="grh_etud15">
3:
4: Select employeid, full name, employee day

SQLSTATE &nbsp;
SQL Select employeeid, name, surname, employee, from employee days, where intervention employee.employeeid = intervention.employee and day = "15/01/2004"
VENDORERRORCODE 3079
DATASOURCE grh_etud15
Resources:
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Coldfusion query problem"
Thread Thread Starter Forum Replies Last Post
Which is best ColdFusion or Flex Groupism Windows Software 7 06-01-2012 10:52 PM
Search text in database using Coldfusion ABDUL KAREEM Software Development 3 05-11-2009 12:53 PM
How to update two database tables coldfusion Rixwel Software Development 3 10-08-2009 03:13 PM
What are the Elements of Coldfusion Expressions Demetrius Software Development 3 30-03-2009 10:57 AM
Problem of SQL query Sonic Software Development 5 18-12-2008 12:28 PM


All times are GMT +5.5. The time now is 06:27 AM.