Update TableA
Set BeginDt = DATEADD(day, 37, BeginDt)
Main Topics
Browse All TopicsI would like to add 37 days to a date field. The following update does not work. What is the correct method to do this?
Update TableA Set BeginDt = DataAdd('d',37,BeginDt)
thanks,
pat
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
simonet said:
>>The integer part of a Datetime field
Alex, you're thinking of how Access, Excel, and VBA/VB6 handle dates and times. In SQL Server, the
datetime data type actually uses two ints, one encoding the day and the other the number of miliseconds
you are into the day. From Books Online:
"Remarks
Values with the datetime data type are stored internally by Microsoft SQL Server as two 4-byte integers. The first 4 bytes store the number of days before or after the base date, January 1, 1900. The base date is the system reference date. Values for datetime earlier than January 1, 1753, are not permitted. The other 4 bytes store the time of day represented as the number of milliseconds after midnight.
The smalldatetime data type stores dates and times of day with less precision than datetime. SQL Server stores smalldatetime values as two 2-byte integers. The first 2 bytes store the number of days after January 1, 1900. The other 2 bytes store the number of minutes since midnight. Dates range from January 1, 1900, through June 6, 2079, with accuracy to the minute."
Business Accounts
Answer for Membership
by: matthewspatrickPosted on 2008-09-17 at 09:35:22ID: 22500696
UPDATE SomeTable
SET BeginDt = DATEADD(d, 37, BeginDt)