Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Date Problem

Author  Topic 

sanjay_jadam
Yak Posting Veteran

53 Posts

Posted - 2005-12-08 : 05:27:54
hi to all,

I face a problem to filter a data between to days

My stored procedure
CREATE PROC TEST
@STARTDATE DATETIME
@ENDDATE DATETIME
AS
SELECT * FROM TESTTABLE WHERE startDate between @STARTDATE and @ENDDATE

Help me

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-08 : 05:35:27
Did you execute the sp?

TEST date1,date2


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

sanjay_jadam
Yak Posting Veteran

53 Posts

Posted - 2005-12-08 : 05:39:27
yes
and i get the problem
In my table date is stored in this format 2005-11-01 means YYYY/MM/DD
and i pass a parameter as 01-11-2005

How can i convert parameter of any format into table date fromat means YYYY/MM/DD

Go to Top of Page

sanjay_jadam
Yak Posting Veteran

53 Posts

Posted - 2005-12-08 : 05:44:47
I done it using
CONVERT Function

Convert(DATETIME,'01-11-2005',103)

Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-12-08 : 05:46:04
what frontend are you using ? asp, .net or vb ?
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-12-08 : 05:50:44
quote:
Originally posted by sanjay_jadam

I done it using
CONVERT Function

Convert(DATETIME,'01-11-2005',103)





Oh didnt see this
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-08 : 05:55:08
Send the date in Universal Format

TEST '20051101','20051130'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -