dbTalk Databases Forums  

Newbie as heck...but my head hurts

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Newbie as heck...but my head hurts in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tdukeman
 
Posts: n/a

Default Newbie as heck...but my head hurts - 08-12-2003 , 03:18 PM







K i've tried some of the solutions that were simple that I found in
other posts, but wasn't successful and performing what I wanted.

Scenario:

I have a form. In that form I have 2 textboxes. One box is called time
The control source for time table1.datetime. The second box I have is
called Name.

I want to be able to automatically populate the field datetime with the
time that record was created. So for example
datetime Name
10:23---------Tomm
10:47---------Mary
10:56---------Migrane Head Ache.

I read one post where someone suggested an "ON Dirty on the form" Now I
presume that they literaly mean in the properties of the form, however I
only find the on dirty selection when I right click the text box...which
I've tried with no luck

Please help..I'm running out of Advil

--
Posted via http://dbforums.com

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Newbie as heck...but my head hurts - 08-13-2003 , 01:37 AM






I presume because you are asking this in a SQL Server forum that you want to
know how to enter this info on the database.

Many ways but here are two

1. At the database level define a DEFAULT constraint with a default value
of GETDATE(). When you issue the INSERT through your stored proc make sure
you don't provide a value for the field

i.e

CREATE TABLE MyTable (PKCol int PRIMARY KEY, Col1 int, col2 smalldatetime
DEFAULT GETDATE())

INSERT MyTable(PKCol, col1) VALUES(1,1)

2. If you are going to pass a value back then have your VB/C++/C# whatever
pass in the current date.


--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"tdukeman" <member35618 (AT) dbforums (DOT) com> wrote

Quote:
K i've tried some of the solutions that were simple that I found in
other posts, but wasn't successful and performing what I wanted.

Scenario:

I have a form. In that form I have 2 textboxes. One box is called time
The control source for time table1.datetime. The second box I have is
called Name.

I want to be able to automatically populate the field datetime with the
time that record was created. So for example
datetime Name
10:23---------Tomm
10:47---------Mary
10:56---------Migrane Head Ache.

I read one post where someone suggested an "ON Dirty on the form" Now I
presume that they literaly mean in the properties of the form, however I
only find the on dirty selection when I right click the text box...which
I've tried with no luck

Please help..I'm running out of Advil

--
Posted via http://dbforums.com



Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.