Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 3rd, 2005, 11:47 AM
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default Convert Char Data Type to smalldatetime

I have a data stored in SQL database. I will called it ship_date. ship_date Data Type is CHAR. The records are stored like this 01/01/05, 02/05/05. I need to filter it using between 01/01/05 to 02/03/05, but since the Data Type is CHAR. the SQL command Between fails. How can I Filter it without changing the Data type directly to the database.

Thanks In advance.
Elmer
Reply With Quote
  #2 (permalink)  
Old March 3rd, 2005, 12:42 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,346
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Try this:

WHERE
   Convert(datetime, ship_date ) BETWEEN '01/01/05' AND '02/03/05'
Reply With Quote
  #3 (permalink)  
Old March 3rd, 2005, 01:26 PM
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default

Great it works thanks jbenson, I really appreciate your help.

Elmer
Reply With Quote
  #4 (permalink)  
Old March 3rd, 2005, 02:13 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,346
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Not a problem, glad I could help and glad it works!

Jim
Reply With Quote
Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
code of convert xml data type in string by C# prafullaborade XML 2 May 24th, 2008 07:49 AM
Big challenge here! How to convert char* to char^? samiswt Visual C++ 2005 1 November 30th, 2007 08:09 PM
Convert from nvarchar(25) to smalldatetime aspless SQL Language 6 September 14th, 2007 09:21 AM
Convert byte[] to char[] mega .NET Framework 2.0 1 December 29th, 2006 10:29 AM
Error with SmallDateTime data type saturdave Classic ASP Databases 1 November 22nd, 2004 06:19 PM



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


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.