Board index » delphi » Using the Date value for assigning Today's date to a field

Using the Date value for assigning Today's date to a field

I am using Delphi 1.0 for the first time to write a database program.
I am having difficulty assigning Today's date to a TdateTimeField.
The following is the assignment statement that I am using:
Tpcrorig.Value := Date;
where Tpcrorig is a TDateTimeField.
I get compiler error 88: "(" expected.
The help screen says:
This error might indicate that the compiler considers the identifier to the left of the insertion point
a type identifier.  In this case, the compiler is looking for an opening parenthesis to make a typecast
expression.

This is telling me that the compiler wants a ( after Date.  This doesn't make sense.
If you have advise then please mail it to ameq...@snds.com.  It would be appreciated.

Thanks,
Mark Catheline

-----------------------------------------------------------------------
This article was posted to Usenet via the Posting Service at Deja News:
http://www.dejanews.com/          [Search, Post, and Read Usenet News!]

 

Re:Using the Date value for assigning Today's date to a field


Quote
MCCathel...@snds.com wrote:
> I am having difficulty assigning Today's date to a TdateTimeField.
> The following is the assignment statement that I am using:
> Tpcrorig.Value := Date;
> where Tpcrorig is a TDateTimeField.

try TpcOrig.AsDateTime := Date;

or TpcOrig.Value := System.Date; { if date is in the unit 'System' (see online help) }

Re:Using the Date value for assigning Today's date to a field


You might want to look at "Now".

Other Threads