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-06 : 03:27:02
select *
FROM [Order]
WHERE (AgentId = '10') AND (DateOfIssue >= @Date_from) AND (DateOfIssue <= @Date_till) AND (ProductId IN (@Publication))

one problem appears ... alghorithmic overflow when converting DateofIssue to datetime ...

any suggestions?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-03-06 : 04:07:45
What is the datatype of DateOfIssue?

Madhivanan

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

kote_alex
Posting Yak Master

112 Posts

Posted - 2009-03-06 : 05:06:01
datetime
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-03-06 : 05:10:48
datetime for sure ? Can you check again.
Go to Top of Page

kote_alex
Posting Yak Master

112 Posts

Posted - 2009-03-06 : 07:33:32
CREATE TABLE [dbo].[Order](
[Id] [int] NOT NULL,
[CompanyId] [int] NOT NULL CONSTRAINT [DF_Order_CompanyId] DEFAULT (1),
[AgentId] [int] NULL,
[DateOfIssue] [datetime] NULL,
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-03-06 : 07:36:51
How do you assing value to @Date_from?

Madhivanan

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

kote_alex
Posting Yak Master

112 Posts

Posted - 2009-03-06 : 08:39:40
quote:
Originally posted by madhivanan

How do you assing value to @Date_from?

Madhivanan

Failing to plan is Planning to fail




I have another data source witch select me the distinct date..
Go to Top of Page
   

- Advertisement -