Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using sysdate in VB

Posted on 2002-04-03
8
Medium Priority
?
3,354 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

604 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