Results 1 to 4 of 4

Thread: Coldfusion query problem

  1. #1
    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>

  2. #2
    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    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.

  4. #4
    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:

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,926,839.60489 seconds with 17 queries