If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Need help with ADD_MONTHS function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-04-03, 10:40
ricocappo ricocappo is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
Need help with ADD_MONTHS function

Assignment reads:

In Procedure Builder, create a procedure named ADD_PROJ_MGR that receives input parameters of the project ID, a consultant ID, and a project duration (in months), and then uses these values to insert a new record into the PROJECT_CONSULTANT table. Use the current system date for the roll-on date, and use the ADD_MONTHS function to calculate the roll-off date. Initialize the project hours to zero.

roll_on_date is a field in a table
roll_off_date is a field in a table

Thanks for any assistance you can provide.

this assignment is from Chapter 5 Lesson B Problem-Solving cases
Advance PL/SQL Programming
Reply With Quote
  #2 (permalink)  
Old 11-04-03, 11:19
mkkmg mkkmg is offline
Registered User
 
Join Date: Oct 2003
Location: Dallas
Posts: 76
example

you can try this....


declare @roll_on_date as datetime
declare @roll_off_date as int

set @roll_on_date= getdate()
set @roll_off_date= '1'


SELECT DATEADD(month, @roll_off_date, @roll_on_date) AS end_date
Reply With Quote
  #3 (permalink)  
Old 11-04-03, 11:21
ricocappo ricocappo is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On