Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset Type Mismatch in SQL

Status
Not open for further replies.

Clarkie001

IS-IT--Management
Aug 26, 2003
59
0
0
GB
Set rs = db.OpenRecordset("SELECT " & strDate & " FROM " & _
Table & " INNER JOIN Temp ON " & Table & "." & CDate(Format(strDate, "dd/mm/yy")) & " = " & CDate(Format("Temp." & strDate, "dd/mm/yy")) & "")

I am using a function to run the above sql. strDate and Table are being returned from the Subroutine which starts this function.
I need to convert strdate because it is a date time.
I am getting a type mismatch with the Inner Join (red). PLease help me to rewrite this last part so it is correctly converted to a date type.

Any help would be much appreciated.

Rgds,

Clarkie
 
Please provide an Example of strDate. What is it filled with? Also, it looks like you are trying to make a date with Temp. in it, which won't work.

Format("Temp." & 11/22/2005, "dd/mm/yy")

Assuming strDate is a date formatted string, returns:

Temp.2.49376558603491E-04

Hardly what you are expecting I am sure.

So provide an example of what strDate is, and what you want the output of the CDate function to be.

Sean.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top