Solved

Using sysdate in VB

Posted on 2002-04-03
8
3,278 Views
Last Modified: 2008-02-01
Hi,

I have a program which has a date when a new row is entered, but I want this date to use sysdate from oracle as opposed to now in vb, but I am not sure if it is possible other than to use a trigger, or straight insert into statement.


.AddNew
!StatusLogID = GetNextId
!STATUSLOGDATEOFCHANGE = Format(Now(), "dd-mmm-
.update
0
Comment
Question by:damienm
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6915359
The only way I have managed to do this is with a SQL statement, in your case an Insert.

Anthony
0
 

Expert Comment

by:mmonacel
ID: 6916274
I would suggest what Anthony had said - write the date as you enter into the DB.  Maybe you can "fake it" by after inserting the record, making a call to retrieve that value from the DB and display it on the screen.  Seems like a lot of overhead to do just to display a date, but if you need it...

0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6916421
mmonacel

I suspect damienm needs the Server date/time not the workstation date/time.

Anthony
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 39

Expert Comment

by:appari
ID: 6916797
or in formload get date from oracle by opening a recordset, keep that in a form level variable and use it whenever you want. but take care to handle the special cases like form may be loaded at 23:59 and update is done at 00:01 the next day ( after 2 minutes).
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6916836
appari,

I suspect damienm is looking for the time as well.

Anthony
0
 
LVL 39

Accepted Solution

by:
appari earned 50 total points
ID: 6916873
why dont you define a default on that column and assign datevalue and forget about its updation?

like

create table test1( A1 date default sysdate,A2 char(2))

0
 
LVL 2

Author Comment

by:damienm
ID: 6917411
This is what I did, except by using alter table.

i.e.

alter table statuslogs
modify (statuslogdateofchange default sysdate)

so that I do not need to put this into the insert statement.
0
 
LVL 2

Author Comment

by:damienm
ID: 6917414
This is what I did, except by using alter table.

i.e.

alter table statuslogs
modify (statuslogdateofchange default sysdate)

so that I do not need to put this into the insert statement.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question