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
 Script Library
 Need help regarding a query while executing

Author  Topic 

kishoremcp
Starting Member

41 Posts

Posted - 2013-12-17 : 12:06:44
Hi,

I have a database which will update automatically on 2nd evening of every month. I have a query which is giving an output. But If i run the same query on 1st of a month then it is not giving any output.

It should not happen like that. The query should not execute and also it should show previous values only if the query is running on 1st of any month.

Any help please...

Regards
Kishore

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2013-12-17 : 12:25:34
You haven't provided enough information for us to help. We need to see the query and some data (what it is doing and what you expect).

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-18 : 06:51:50
quote:
Originally posted by kishoremcp

Hi,

I have a database which will update automatically on 2nd evening of every month. I have a query which is giving an output. But If i run the same query on 1st of a month then it is not giving any output.

It should not happen like that. The query should not execute and also it should show previous values only if the query is running on 1st of any month.

Any help please...

Regards
Kishore


where are you executing it from? is it automated in a sql server agent job? See the logic used for date part. Thats were you need to apply the 2nd day of month logic
post your currently used query if you need more assistance.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -