PC Review


Reply
Thread Tools Rate Thread

calendar date, strings and SQL

 
 
pdunn
Guest
Posts: n/a
 
      24th Sep 2008
Hello, I am a major minor problem.
I am getting the date from the calendar control to pass through to SQL to
return certain rows.

The SQL function works with me typing in
strSQL = "Select * from Table Where sDate = ""09/10/2008"""

However using,
Dim dtDate as Date
dtDate = Me.Calender0.value
strSQL = "Select * from Table Where sDate = ""
strSQL = strSQL & CStr(dtDate) & """

nor excluding CStr() works

when testing
if CStr(dtDate) = "09/10/2008" then msgbox(something) end if

the msgbox does not appear

on a side note, using strCompare seems to state they are equal.

any help with being able to get a value from a Calendar control and place it
into a sql statement to access a database would be helpful. Also,
parameterized query MIGHT be helpful, but I am just exploring any options.

Thank you,

PDunn
 
Reply With Quote
 
 
 
 
pietlinden@hotmail.com
Guest
Posts: n/a
 
      24th Sep 2008
strSQL = "Select * from Table Where sDate = ""09/10/2008"""

the normal delimiter for dates in Access SQL is #, so try this:

strSQL = "Select * from Table Where sDate = #09/10/2008#
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
appending date to other strings sushi155 Microsoft Access Queries 0 28th Jul 2005 08:00 PM
Problem - Calendar to Inbox to Calendar moves date to current date =?Utf-8?B?amVzc2ljYQ==?= Microsoft Outlook Calendar 1 6th Jun 2005 03:05 PM
I need some 'how to' on time/date strings please... Trint Smith Microsoft VB .NET 4 18th Feb 2004 03:20 PM
Sorting date strings Dave Cullen Microsoft Access Queries 4 18th Aug 2003 09:18 PM
Date Format and Strings David Webb Microsoft Dot NET Compact Framework 1 18th Jul 2003 08:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:00 PM.