To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here

HOME News MS SQL Oracle DB2 Access MySQL PHP Scripts Books Links DBA Talk


Go Back   Database Journal Forums > Related Sites > SQL Course

SQL Course SQL Course > Ask questions about the lessons on SQL Course 1 and 2. If you have problems > with the interface, please post in the Feedback forum

Reply Post New Thread
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-24-2002, 09:01 AM
Markus Markus is offline
Member
 
Join Date: Sep 2002
Location: Amsterdam
Posts: 53
date selection

When I query a table with a datetype field I get the date in european format (dd-mm-yy(yy)). However, whenever I try to make a selection using a comparison string in the WHERE clause like '22-09-2002' I get no results. When I change the string in the USA format (09-22-2002) it gives the expected results. Which config/installation setting governs this behaviour?

Thnx
Reply With Quote
  #2  
Old 09-24-2002, 11:06 AM
Oleg Zernov Oleg Zernov is offline
Junior Member
 
Join Date: Sep 2002
Location: Moscow, Russia
Posts: 1
date selection

In situations like this you should use
'convert' function in WHERE clause
(See the description in SQL BOL).
If you write
convert(datetime, '22-09-2002', 105)
instead of
'22-09-2002'
you'll get the expected result, so you
may not be aware about the current date format settings.
Reply With Quote
  #3  
Old 09-24-2002, 11:45 AM
Markus Markus is offline
Member
 
Join Date: Sep 2002
Location: Amsterdam
Posts: 53
Re: date selection

Quote:
Originally posted by Oleg Zernov
In situations like this you should use
'convert' function in WHERE clause
(See the description in SQL BOL).
If you write
convert(datetime, '22-09-2002', 105)
instead of
'22-09-2002'
you'll get the expected result, so you
may not be aware about the current date format settings.

Thanks Oleg.
Reply With Quote
Reply Post New Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes 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 Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:27 PM.


DatabaseJournal Recent Articles


 » Searching and Sorting Strings in Oracle

 » Preparing To Upgrade Access Tables to SQL ...

 » Sun Expands MySQL With Closed Source

 » Microsoft Demos New SQL Server Features at...

 » Wipro and Oracle Launch First Joint Innova...

Search Database Journal:
 





Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.