Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 9th, 2004, 10:18 PM
Registered User
Join Date: Dec 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Use Begin_Date to update End_Date field (+90days)

I am new to triggers and scripts.
I have a table that contains 2 fields. Begin_Date and End_Date.
The Begin_date is entered into SQL 2003 via a front end software program.

ON entry of the begin date is is possible to have a trigger fire that would automatically populate the End_Date field with the following result. End_date = Begin_Date +90 Days.

Could you recommend a procedure and possible script.



Reply With Quote
  #2 (permalink)  
Old December 9th, 2004, 11:17 PM
Friend of Wrox
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc

You can add this to your trigger

Update your table
set End_date=Begin_date +90

1. Make sure you have a where clause for the records you want to update
2. Are updating just new records or existing records
3. If this will be your default use a constraints

Jaime E. Maccou
Reply With Quote

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 Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Date Field desireemm Access 1 October 16th, 2005 12:25 AM
Table field update ibelta Access 4 February 12th, 2005 08:22 PM
Trying to update a date field jfrizelle Classic ASP Databases 3 November 4th, 2004 08:55 AM
Update city field based on zip field nganb SQL Server ASP 0 April 22nd, 2004 10:30 PM
Update a date field levinll SQL Language 1 January 16th, 2004 02:41 PM

All times are GMT -4. The time now is 07:17 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.