Click here to Skip to main content
15,909,896 members
Home / Discussions / Database
   

Database

 
AnswerRe: fetching Data Using Group By Clause Pin
nguyenvhn16-Apr-06 20:53
nguyenvhn16-Apr-06 20:53 
Questionproblem converting varchar to datetime Pin
shabonaa16-Apr-06 16:42
shabonaa16-Apr-06 16:42 
QuestionRe: problem converting varchar to datetime Pin
Eric Dahlvang17-Apr-06 3:23
Eric Dahlvang17-Apr-06 3:23 
AnswerRe: problem converting varchar to datetime Pin
shabonaa17-Apr-06 6:41
shabonaa17-Apr-06 6:41 
AnswerRe: problem converting varchar to datetime Pin
Eric Dahlvang17-Apr-06 9:57
Eric Dahlvang17-Apr-06 9:57 
GeneralRe: problem converting varchar to datetime Pin
shabonaa17-Apr-06 13:48
shabonaa17-Apr-06 13:48 
GeneralRe: problem converting varchar to datetime Pin
ThaScorpion17-Apr-06 15:08
ThaScorpion17-Apr-06 15:08 
AnswerRe: problem converting varchar to datetime Pin
Eric Dahlvang18-Apr-06 3:22
Eric Dahlvang18-Apr-06 3:22 
Try changing your stored procedure to this:

CREATE PROCEDURE cst 
@v datetime
AS
SELECT * FROM col WHERE CASE WHEN ISDATE(col)=1 THEN CAST ( col AS DATETIME ) ELSE @v END < @v
GO


I'm not sure why there is a problem with the CAST, but checking to make sure that the col ISDATE() will most likely avoid the problem. However, records that have a col column are not able to be converted will not be returned.

Does this help?

----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin

GeneralRe: problem converting varchar to datetime Pin
shabonaa19-Apr-06 8:38
shabonaa19-Apr-06 8:38 
AnswerRe: problem converting varchar to datetime Pin
Eric Dahlvang19-Apr-06 10:11
Eric Dahlvang19-Apr-06 10:11 
GeneralRe: problem converting varchar to datetime Pin
shabonaa19-Apr-06 12:55
shabonaa19-Apr-06 12:55 
AnswerRe: problem converting varchar to datetime Pin
HimaBindu Vejella17-Apr-06 18:48
HimaBindu Vejella17-Apr-06 18:48 
QuestionADO SHAPE Command - Can we use temporary tables? Pin
Babto16-Apr-06 10:32
Babto16-Apr-06 10:32 
QuestionAdapt This please Pin
munklefish16-Apr-06 7:19
munklefish16-Apr-06 7:19 
AnswerRe: Adapt This please Pin
Michael Potter17-Apr-06 3:19
Michael Potter17-Apr-06 3:19 
QuestionSQL Problems Pin
munklefish16-Apr-06 4:20
munklefish16-Apr-06 4:20 
AnswerRe: SQL Problems Pin
Mike Ellison16-Apr-06 5:07
Mike Ellison16-Apr-06 5:07 
GeneralRe: SQL Problems Pin
munklefish16-Apr-06 5:16
munklefish16-Apr-06 5:16 
GeneralRe: SQL Problems Pin
Mike Ellison16-Apr-06 5:32
Mike Ellison16-Apr-06 5:32 
GeneralRe: SQL Problems Pin
munklefish16-Apr-06 5:47
munklefish16-Apr-06 5:47 
GeneralRe: SQL Problems Pin
Mike Ellison17-Apr-06 5:48
Mike Ellison17-Apr-06 5:48 
GeneralRe: SQL Problems Pin
munklefish17-Apr-06 6:58
munklefish17-Apr-06 6:58 
Questionasp .net add a record to my database Pin
bambo123414-Apr-06 20:55
bambo123414-Apr-06 20:55 
AnswerRe: asp .net add a record to my database Pin
Jerry Hammond15-Apr-06 17:16
Jerry Hammond15-Apr-06 17:16 
GeneralRe: asp .net add a record to my database Pin
bambo123415-Apr-06 21:18
bambo123415-Apr-06 21:18 

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.