Go Back   DeveloperBarn Forums > Databases > SQL Development

Sponsored Links

Discuss "date problem in access" in the SQL Development forum.

SQL Development - Structured Query Language (SQL) is the talk of databases. Discuss topics such as joins, triggers and other advanced SQL topics.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old August 17th, 2008, 04:21 PM
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 date problem in access

Hi,


I am using access database and I have a table called Employees

There is a field called Emp_Date the datatype is Text

for example the Emp_Date is like this

09/12/2007


I Have my query like this

Code:
strgetrecords =  "SELECT * from Employees order by convert(datetime, Employees.Emp_Date) desc"
I want to display records from latest date to old date

it gives an error

can someone tell me If i am doing the conversion in the right way

todd
Reply With Quote
Sponsored Links
  #2  
Old August 17th, 2008, 04:22 PM
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

it gives an error saying undefined function convert in expression
Reply With Quote
  #3  
Old August 17th, 2008, 04:32 PM
don94403's Avatar
Moderator


 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 63
Thanks: 3
Thanked 8 Times in 8 Posts
Blog Entries: 2
Rep Power: 1
don94403 is on a distinguished road

Awards Showcase
PHP Microsoft Access 
Total Awards: 2

Default

Quote:
Originally Posted by todd2006 View Post
it gives an error saying undefined function convert in expression
That should give you the answer. Access doesn't have a function named "convert". When you get such an error message, the first thing you should do is look in the documentation and find out what functions Access has.

BY FAR, the best solution is to always store date information in Date data type fields. If this cannot be done in your situation, then you can use a legitimate Access function like CDate().
Reply With Quote
Reply

  DeveloperBarn Forums > Databases > SQL Development

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
access problem todd2006 SQL Development 7 August 4th, 2008 09:17 PM
access problem todd2006 Microsoft Access 4 July 30th, 2008 11:38 AM
another access problem todd2006 ASP Development 5 July 30th, 2008 11:09 AM
date problem todd2006 SQL Development 2 July 7th, 2008 01:52 PM
date problem todd2006 SQL Development 1 May 12th, 2008 01:51 PM


All times are GMT -4. The time now is 07:50 PM.



Content Relevant URLs by vBSEO 3.2.0