Click here to Skip to main content
16,011,444 members
Home / Discussions / Database
   

Database

 
GeneralHELP (search in the image data type) (MSSQL Server) Pin
Archigal16-Sep-02 10:16
Archigal16-Sep-02 10:16 
GeneralAccessing MS SQL-Server via ADO Pin
am_16-Sep-02 3:10
am_16-Sep-02 3:10 
GeneralRe: Accessing MS SQL-Server via ADO Pin
Jon Hulatt16-Sep-02 22:19
Jon Hulatt16-Sep-02 22:19 
GeneralRe: Accessing MS SQL-Server via ADO Pin
am_16-Sep-02 22:38
am_16-Sep-02 22:38 
GeneralRe: Accessing MS SQL-Server via ADO Pin
Jon Hulatt16-Sep-02 23:45
Jon Hulatt16-Sep-02 23:45 
GeneralRe: Accessing MS SQL-Server via ADO Pin
am_17-Sep-02 1:55
am_17-Sep-02 1:55 
GeneralRe: Accessing MS SQL-Server via ADO Pin
Doug15-Oct-02 15:29
Doug15-Oct-02 15:29 
GeneralConvert Varchar/DateTime help pleeeeeeeze Pin
Megan Forbes15-Sep-02 23:49
Megan Forbes15-Sep-02 23:49 
Hi there

This should be simple to fix - unfortunately I seem to just be missing something Frown | :(

My ASP page sends through something like 16/09/2002, I recieve it as a varchar. I then need to convert to datetime, and use it with another date to select records for a statement.

I have tried the following:

set @in_start_date = convert(datetime, @in_start_date)
set @in_start_date = convert(datetime, @in_start_date,109)
set @in_start_date = CAST(@in_start_date AS datetime)

All 3 give me a date, but also a message saying:

Server: Msg 242, Level 16, State 3, Line 12
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

Because of the out of range datetime value my stored procedure can't work with the date values & pass the results back to the crystal report.

How do you guys convert varchar dates with "/" separating dd/mm/yyyy to datetime format? Thanks very much Confused | :confused:


The following statement about your geekness is true. The previous statement about your geekness is not true.

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT/P d- s: a- C++++$ UL+>++++ P+ L++$ E- W+++$ N !o K+ w++$ O---- M--
PS- PE Y+ PGP--- t !5 X- tv b+++ DI++ D+ G++ e++>e+++ h--- r+++
------END GEEK CODE BLOCK------

GeneralRe: Convert Varchar/DateTime help pleeeeeeeze Pin
Jon Hulatt16-Sep-02 1:47
Jon Hulatt16-Sep-02 1:47 
GeneralRe: Convert Varchar/DateTime help pleeeeeeeze Pin
Richard Deeming16-Sep-02 7:53
mveRichard Deeming16-Sep-02 7:53 
Generalno current record Pin
Mike Fenske13-Sep-02 7:58
Mike Fenske13-Sep-02 7:58 
GeneralMDAC 2.7 May Contain A Regression... Pin
James R. Twine13-Sep-02 5:36
James R. Twine13-Sep-02 5:36 
GeneralOracle error Pin
Bill Dean12-Sep-02 4:16
Bill Dean12-Sep-02 4:16 
GeneralRe: Oracle error Pin
Mark Conger13-Sep-02 8:54
Mark Conger13-Sep-02 8:54 
GeneralSQLServer problem: fetching TEXT field using OLE DB Pin
taualex12-Sep-02 3:40
taualex12-Sep-02 3:40 
GeneralRe: SQLServer problem: fetching TEXT field using OLE DB Pin
James R. Twine13-Sep-02 5:39
James R. Twine13-Sep-02 5:39 
GeneralRe: SQLServer problem: fetching TEXT field using OLE DB Pin
taualex13-Sep-02 8:04
taualex13-Sep-02 8:04 
GeneralRe: SQLServer problem: fetching TEXT field using OLE DB Pin
James R. Twine13-Sep-02 9:02
James R. Twine13-Sep-02 9:02 
QuestionTRICKY - How to SELECT TOP X records when using UNION? Pin
Garth11-Sep-02 17:31
Garth11-Sep-02 17:31 
AnswerRe: TRICKY - How to SELECT TOP X records when using UNION? Pin
Rein Hillmann11-Sep-02 19:11
Rein Hillmann11-Sep-02 19:11 
AnswerRe: TRICKY - How to SELECT TOP X records when using UNION? Pin
Richard Deeming13-Sep-02 6:01
mveRichard Deeming13-Sep-02 6:01 
GeneralSQLDMO & DTS Pin
Paul Watson10-Sep-02 7:08
sitebuilderPaul Watson10-Sep-02 7:08 
GeneralRe: SQLDMO & DTS Pin
Nick Parker11-Sep-02 13:12
protectorNick Parker11-Sep-02 13:12 
Questionsp_OASetProperty limitations? Pin
Jeremy Falcon6-Sep-02 7:50
professionalJeremy Falcon6-Sep-02 7:50 
AnswerRe: sp_OASetProperty limitations? Pin
Jeremy Falcon6-Sep-02 9:33
professionalJeremy Falcon6-Sep-02 9:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.