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
 General SQL Server Forums
 New to SQL Server Programming
 Report Server

Author  Topic 

kote_alex
Posting Yak Master

112 Posts

Posted - 2009-03-02 : 08:23:11
so this is my query :
select * from [order]
where agentid='10'

and Dateofissue in (@Data_from)
and dateofissue in (@Date_Till)

So how can I link these together ? If I want to see something from 1 january till 1 february ... how can I make this happen ?

10x !

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-03-02 : 08:26:56
select * from [order]
where agentid='10'
and Dateofissue between (@Data_from) and (@Date_Till)
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-03-02 : 08:28:31
Dateofissue >=@Data_from and dateofissue <=@Date_Till
Go to Top of Page

kote_alex
Posting Yak Master

112 Posts

Posted - 2009-03-02 : 08:51:16
neither works... because I have a separate dataset for both of them in witch I wrote :
select distinct dateofissue from [order]
where agentid='10'

so maybe something not wright
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 08:55:22
quote:
Originally posted by kote_alex

neither works... because I have a separate dataset for both of them in witch I wrote :
select distinct dateofissue from [order]
where agentid='10'

so maybe something not wright



is Dateofissue of datetime type? also does dateofissue has timepart also?
Go to Top of Page

kote_alex
Posting Yak Master

112 Posts

Posted - 2009-03-02 : 09:08:13
Yes ! it's datetime
Go to Top of Page
   

- Advertisement -