Go Back   DeveloperBarn Forums > Databases > Microsoft Access

Sponsored Links

Discuss "convert problem" in the Microsoft Access forum.

Microsoft Access - Microsoft Access is a database for small to medium applications. Learn tips and tricks and best database practices here.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old July 6th, 2008, 11:43 AM
Barn Frequenter

 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default convert problem

Hi,

I am using access

strsql="SELECT Distinct State from Camps where Convert(datetime,Camp_Date) > getdate()"

The Camp_Date field is a text field in table Camps

the data for example stored in camp_date is like this 3/3/2009

it gives me an error saying Undefined function 'Convert' in expression

can someone tell me what i am doing wrong

todd
Reply With Quote
Sponsored Links
  #2  
Old July 6th, 2008, 12:03 PM
Barn Newbie

 
Join Date: Mar 2008
Posts: 40
Thanks: 0
Thanked 4 Times in 4 Posts
Rep Power: 1
lewy is on a distinguished road
Default

Access doesn't have a Convert function for datetime, SQL server does
Access doesn't have a function called getDate(), SQL server does

What you're looking for is to use CDate as follows
Code:
strsql="SELECT Distinct State from Camps where CDate(Camp_Date) > Today()"
Reply With Quote
  #3  
Old July 7th, 2008, 02:17 AM
AOG123's Avatar
Lightning Master

 
Join Date: Mar 2008
Location: Fortress Of Solitude
Posts: 93
Thanks: 6
Thanked 23 Times in 18 Posts
Rep Power: 1
AOG123 is on a distinguished road

Awards Showcase
Microsoft Access 
Total Awards: 1

Default

lol, what you need is,.

Code:
strsql="SELECT Distinct State from Camps where CDate(Camp_Date) > Date()"
Today() is not a built in function either.
__________________
If i helped you, make me famous by clicking the
Reply With Quote
Reply

  DeveloperBarn Forums > Databases > Microsoft Access

Bookmarks

Thread Tools
Display Modes

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 On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert problem todd2006 ASP Development 5 June 27th, 2008 03:47 PM


All times are GMT -4. The time now is 02:46 PM.



Content Relevant URLs by vBSEO 3.2.0