469,148 Members | 1,446 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,148 developers. It's quick & easy.

Sql View

I am doing a monthly report to export to an excel Doc from SQL 2000
using views.
With my design it works great until it is the first of the month. As the
report always
checks from yesterday to the first of the current month. One view is below.
The date statement checks between the first of month and current date -1

Can anyone help with with this?
Mike

CREATE VIEW dbo.GUTUR
AS
SELECT COUNT(*) AS GUTUR
FROM dbo.Chev
WHERE ([Deal Date] BETWEEN DATEADD(mm, DATEDIFF(mm, 0, GETDATE()), 0)
AND GETDATE() - 1) AND ([N/U] = 'U') AND (([Sales Type] = 'R') or ([Sales
Type] = '3'))


Jul 23 '05 #1
1 1999
On Mon, 3 Jan 2005 13:22:59 -0800, Mike Lander wrote:

(snip)

Hi Mike,

You already asked this question in microsoft.public.sqlserver.server and
you already got some answers there. Please keep the discussion in one
place, okay?

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by js | last post: by
3 posts views Thread by M. Mehta | last post: by
4 posts views Thread by Ryan | last post: by
8 posts views Thread by Jef Driesen | last post: by
4 posts views Thread by Neil | last post: by
12 posts views Thread by Neil | last post: by
10 posts views Thread by Zack Sessions | last post: by
1 post views Thread by Nogusta123 | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.