Home > SQL Development > [Query - General] Conversion failed when converting character string to smalldatetime data type

[Query - General] Conversion failed when converting character string to smalldatetime data type



Hi ... the date is getting translated by the server into datetime. When i execute my query in query analyser am getting this error "Conversion failed when converting character string to smalldatetime data type."

This is my Query

Code:


SELECT iCalls_Calls.CALL_ID, iCalls_Calls.REQUESTOR,iCalls_Calls.REQ_DATE,iCall  s_Calls.CLOSED_DATE, iCalls_Users.USER_NAME, DESCRIPTION, TYPE, SCOPE, SEVERITY, iCalls_Calls.STATUS_ID, iCalls_Status.STATUS_ID, iCalls_Status.STATUS_LABEL FROM ((iCalls_Calls inner join iCalls_Status on iCalls_Calls.STATUS_ID=iCalls_Status.STATUS_ID) inner Join iCalls_Users on iCalls_Calls.REQUESTOR=iCalls_Users.USER_ID) left outer join iCalls_Messages on iCalls_Calls.CALL_ID=iCalls_Messages.CALL_ID WHERE RESPONSIBLE='" & Session("USER_ID") & "' AND iCalls_Calls.STATUS_ID <> 6 AND iCalls_Calls.REQ_DATE between '" & txtSTdate.Text & "' and '" & txtCLdate.Text & "' ORDER BY iCalls_Calls.CALL_ID


..

So what can be the correct Query. Help me with this.

Thanks.

    
Guest


--> Thread moved to SQL Development



yasinirshad,



This has nothing to do with .Net Development, it's SQL related. Make sure you post your questions in the correct forums from now on. We have told you more than once.

Was this answer helpful ? Yes No   
Guest


obviously, the text inside txtSTdate and/or txtCLdate is not valid

as date/time.

it's either blank, or it might be "vmnv0s f" or any other string.

to prevent error, you can use IsDate function but if you want it working

you'll simply have to give correct date..

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved