Re: Today's date in Access

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Albert D. Kallal (PleaseNOOOsPAMMkallal_at_msn.com)
Date: 06/20/04


Date: Sun, 20 Jun 2004 14:32:44 -0600

If you are talking about the current form, and that table that the form is
bound to, then it takes ONE LINE of code.

me!MyDateField = date()

I don't think oracle, or any other system on the planet is going to be less
then one line of code...since that would mean no code!

It is not clear if mean update the time to the current table, or you wish to
write out a new record to antoher table each time the current record is
modified?

That being the case, you could use the after udate event:

dim strSql as string

strSql = "INSERT INTO tblLog (fk_id, dtStamp) & _
             " values (" & me.id & ", #" & formate(date,"mm/dd/yyyy") &
"# )"
currentdb.Execute strSql

The aboove would udpate to a another table, and you could place the above in
the after update event of the form. I could 3 lines max of code, and again,
I don't see oracle, or any other platform being less lines of code.

"James" <anonymous@discussions.microsoft.com> wrote in message
news:1e9b301c45695$a3bd3b20$a301280a@phx.gbl...
> How can I use a form button to insert today's date in a
> table, to leave a transction log?
>
> I have tried putting the current date in a SQL string
> that I run with doCmd in VBA, but if the data type in the
> table is date/time, I get rubbish (31/12/1899, or some
> such). It looks OK if I change the data type in the
> table to string, but I need it to be a date type for
> calculation.
>
> This would be dead easy in Oracle.
>
> Thanks
>
> James
>
>



Relevant Pages

  • Re: Insert Oracle Linked Server timestamp error...
    ... I finally did receive a response from Microsoft support, ... supported in Oracle, but basically the timestamp, clobs and blobs were out ... >>Oracle introduced a new data type timestamp, ... >>seem to be updateable or insert via SQL Server linked server. ...
    (microsoft.public.sqlserver.odbc)
  • Re: null and default value compression
    ... I am not 100% sure what you are asking but all versions of Oracle ... inserted for the row Oracle can skip even writing the null indicators ... Oracle has also recommended using what is now the varchar2 data type ...
    (comp.databases.oracle.misc)
  • Re: NUMBER(p) vs. INTEGER data type and CHAR(x) vs. VARCHAR2(x) in Oracle 10g and 9i - advantage
    ... scale) gives you an integer, constrained by a max of p digits. ... since 38 is the max precision? ... CHAR data type? ... There are numbers in the Oracle DB, the definitions of the others are types ...
    (comp.databases.oracle.server)
  • Re: Problem while migrating data with Memo content from VFP to Oracle
    ... What data type are you using on the oracle side to hold the memo data? ... What data type is VFP mapping that to when it creates the remote view? ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Todays date in Access
    ... It looks OK if I change the data type in the ... you've failed to properly delimit the date value with hash-marks, ... or else clearly specify the value as a date literal (in US format), ... That would give you this SQL string: ...
    (microsoft.public.access.formscoding)