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
 Change a date in store proc

Author  Topic 

h2sut
Starting Member

40 Posts

Posted - 2008-04-04 : 12:18:50
Hello i have this store proc with the syntax below. The getdate get the current date but i need to change the date this one time to 3/20/2005. I was wondering is there a way to do that an not modify my sp. I tried to harcode 3/20/2005 as asofdate and i get all 0 in my table.

getDate() AS AsOfDate'

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-04-04 : 12:32:59
How can you hard-code the date without changing the SP?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-04 : 12:38:07
Where is the value for datefield currently assigned in SP?
Go to Top of Page

h2sut
Starting Member

40 Posts

Posted - 2008-04-04 : 12:44:36
I was able to fix it . just did
update dbo.Production
set AsOfDate = '3/21/2008'
where asofdate not like '3/21/2008'
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-05 : 02:50:04
quote:
Originally posted by h2sut

I was able to fix it . just did
update dbo.Production
set AsOfDate = '3/21/2008'
where asofdate not like '3/21/2008'


Isnt this differnet from what you have asked for?

Madhivanan

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

- Advertisement -