I've tried using createodbcdatetime but its still not working:

SELECT classes.*, classDates.*
FROM
(classes INNER JOIN classDates ON (classes.classID = ""> WHERE classDates.classDate = #createodbcdatetime(EventDay)#

I'm at a loss as to why this join isn't working.

when I do the join, no matter what I use in the WHERE clause the most I get
one record

the FIRST record in the classes table

I, of course, have

<cfquery name="getDay" datasource="">

SQL

</cfquery>

<cfoutput query="getDay">

</cfquery>

gil

  -----Original Message-----
  From: Ubqtous [mailto:[EMAIL PROTECTED]
  Sent: Thursday, October 16, 2003 10:51 AM
  To: CF-Talk
  Subject: Re: simple join not working

  mayo,

  On 10/16/2003 at 10:36, you wrote:

  m> I must be getting really tired. I hate to ask such qustions but now I
can't
  m> even get a simple join to work.

  m> I did several simple queries,  each worked (including the all important
date
  m> query)

  m>         SELECT *
  m>         FROM classDates
  m>         WHERE classDates='10/11/2003'  // does not work: "Data type
mismatch in
  m> criteria _expression_. "
  m>         WHERE classDates LIKE '10/11/2003' does work
  m>         WHERE classDates LIKE '#eventDay#' does work

  m> My INNER JOIN:

  m>         SELECT classes.*, classDates.*
  m>         FROM classes INNER JOIN classDates ON classes.classID =""> classDates.classID
  m>         WHERE classDates.classDate LIKE '#EventDay#'

  m> It doesn't work, even when using other fields than classDate.
  m> (I'm using Access 2000)

  What is the data type of the classDates field? Maybe try:

  where classDates=<cfqueryparam value="10/11/2003"
cfsqltype="cf_sql_timestamp">
  (match cfsqltype to classDates data type)

  or

  where classDates=#createodbcdatetime("10/11/2003")#
  (assuming classDates is a date/time field)

  You shouldn't have to use LIKE to make this work, that's for sure.

  ~ Ubqtous ~


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to