problem specifying timedate constant

 
The following code:

datetime SomeTime=D'08:28:00';

yields the following error:


'08:28:00' - date literal string is incomplete

Yet, the docs indicate you can specify a time constant as follows:

D'12:30:27' //equal to D'[compilation date] 12:30:27'

What's wrong here? Is it not possible to specify a time constant without the date portion?
 
billworld:
The following code:

datetime SomeTime=D'08:28:00';

yields the following error:


'08:28:00' - date literal string is incomplete


I've been hit by this myself recently. :)

This is not an error. Just a warning that gives extra precaution against possibly wrong date.
 
Irtron:
billworld wrote:
The following code:

datetime SomeTime=D'08:28:00';

yields the following error:


'08:28:00' - date literal string is incomplete


I've been hit by this myself recently. :)

This is not an error. Just a warning that gives extra precaution against possibly wrong date.

Got it. Certainly odd behavior for the compiler to flag something as "incomplete" which is coded exactly as indicated in the docs...
Reason: