Hi, I have a datawindow where I have a date field. I want to specify an initial value into that date field when a row is retrieved from the database. From the Column Specification
, I want to set the initial date value of that field to current date. Is there any keyword or function which I can write in the Initial Value
field?
views:
46answers:
2
+2
A:
today()
should do it.
As Hugh says, you don't want to trust the client machine's clock for accurate time, but this is fine to initialize a data entry field to a sensible default.
Colin Pickard
2010-10-14 13:38:57
No, it doesn't work.
Night Shade
2010-10-18 03:48:19
+2
A:
As a general rule, it's a bad idea to use the client's clock. It could be set to 1986 for all you know. Select the server's date in a hidden field and copy it to the table column. Another solution is to let the client put whatever it thinks the date/time is in the column (as in Colin's answer), then update it to server time in a post-insert trigger.
Hugh Brackett
2010-10-14 16:23:30