Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2005, 10:32 PM
Authorized User
 
Join Date: Jul 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default Simple Question - SQL Statement

Hello, I get the following error:

"Data type mismatch in criteria expression"

Where I try to run the following SQL Statement:


strSQL = "SELECT InterviewAvailability.InterviewAvailabilityID, InterviewAvailability.UserAccountID, UserAccount.FullName, UserAccount.Username, InterviewAvailability.AvailabilityDate, InterviewAvailability.StartTime, InterviewAvailability.EndTime, InterviewAvailability.UnavailableTypeID, NonAvailableType.NonAvailableType, InterviewAvailability.Confirmed, InterviewAvailability.Other FROM UserAccount INNER JOIN (NonAvailableType INNER JOIN InterviewAvailability ON NonAvailableType.NonAvailableTypeID = InterviewAvailability.UnavailableTypeID) ON UserAccount.UserAccountID = InterviewAvailability.UserAccountID WHERE (((InterviewAvailability.AvailabilityDate)= ' # mdatShiftDateFilter # ') AND ((InterviewAvailability.StartTime) " & mstrShiftTimeFilter & " ) AND ((InterviewAvailability.Confirmed)=True));"

I think I am having trouble getting the variable right for the mdatShiftDateFilter which is Datetime data type.

Please any help is appricated.

Thanks in advance,
Mark

 
Old January 11th, 2005, 09:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

(InterviewAvailability.StartTime) = " & mstrShiftTimeFilter & " )

And is this a date time field too?



 
Old January 11th, 2005, 09:28 AM
Authorized User
 
Join Date: Jul 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes it is a date field. But I am passing in < 5:00 PM, I pass it all in a string statement. The query works fine if I replacemdatShiftDateFilter with #01/10/2005#.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble with simple JOIN statement zoltac007 SQL Server ASP 1 May 31st, 2007 10:09 AM
Very Simple SQL Question?? mrideout BOOK: Beginning ASP.NET 1.0 3 September 20th, 2004 08:07 PM
Simple SQL Question cjmarek Classic ASP Databases 1 July 10th, 2004 04:11 AM
Simple Question - SQL for retrieving different row wanda46 Access 5 June 9th, 2004 01:17 PM
Simple but not working IF THEN statement nlicata Classic ASP Databases 6 June 6th, 2003 10:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.