ADP TIME

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is probably easy for someone out there So Please help. I use to have a
button which when pressed it will place the now time and date value into a
field. In md, Access this looked like "field = now() or Time() " . I just
upsized to SQL and now time() gives the correct time but the date is 1989.
Getdate() gives an error function not defined. What am I doing wrong ?
 
Getdate() should be the proper function to return the date and time when
working against SQL-Server. How are you calling this function in your ADP
project?

Also, the newsgroup for ADP is m.p.access.adp.sqlserver.
 
Thankyou for trying but getdate does not work I get an error "function not
defined". In fact if I put the parenthesis at the end I get the error. If I
remove them I get an erroneous date in the 1800 with the correct time.

Forms(x)!field = getdate() where x is an index for the right form and field
is the name of the field where the date is placed. Thanks in advance again.
Using windows 2003 server with windows XP office and SQL in win 2003 server.
 
When you write something like « Forms(x)!field = getdate() »; you are
working locally in VBA code and this has nothing to do with SQL-Server; even
when you are using an ADP project. In VBA code, you must use Now() to get
the time and date and Time() to get only the time.

However, when you will transfert these values to SQL-Server, you might run
into problems because the value for a null date (ie, to get a datetime field
to display only the time only) is not the same on SQL-Server (1-1-1900) than
on Access (30-12-1899).
 
Back
Top