Wrox Programmer Forums
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 13th, 2007, 05:28 AM
Authorized User
 
Join Date: Jan 2005
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hossrad
Default Default Values On Fields

Hi,
I have a problem here,
Can i set a default value for a field from the value of another field
let me explain :
I Have a two fields,
1- DocDate datetime
2- EffectDate datetime
no i want the Default value of EffectDate field be the value of DocDate field.
I Cant set the default value for EffectDate.
Can anyone help?

God Bless you,
Hossein
__________________
Be Sure,
-hossrad
 
Old May 14th, 2007, 12:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can't have value of a column set as default for another column. AFAIK, You got to have a trigger set on EffectDate for the relavant DML to hold the value of DocDate into EffectDate.

Cheers.

_________________________
- Vijay G
Strive for Perfection
 
Old May 15th, 2007, 02:27 AM
Authorized User
 
Join Date: Jan 2005
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hossrad
Default

Again Thanks for Help.

God Bless you,
Hossein





Similar Threads
Thread Thread Starter Forum Replies Last Post
setting default values prithvi28 XSLT 1 October 3rd, 2006 01:38 PM
Default Values for Query Odifius Access VBA 3 September 20th, 2006 06:30 AM
Default values? Raymie_C Access VBA 2 May 16th, 2005 11:48 AM
Default Values davest Access VBA 2 October 19th, 2004 05:57 AM





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