Calculated value in a query

  • Thread starter Thread starter Denis
  • Start date Start date
D

Denis

I am trying to create three calculated fields which would return the day,
month and year of date field ArriveDate in a table named Booking but can't
seem to make it work.

I have tried Aday: Left([booking].[ArriveDate],2) and
Left([booking.ArriveDate],2) but I get an error message when i run the query
(Invalid bracketing of name).

Would appreciate any help in solving this (I hope) small problem.

Denis
 
I get an error message when i run the query (Invalid bracketing of name).
Left([booking.ArriveDate],2) -- if you use an opening bracket for
table name you also need a closing for it. if you use an opening bracket
for field name you also need a closing for it.
Left([booking].[ArriveDate],2)

But dates are stored as a double precision number like this 39555.33 for
4/17/2008 7:56:08 AM.
You can use Day([booking.ArriveDate]), Month([booking.ArriveDate]), and
Year([booking.ArriveDate]) or Format([booking.ArriveDate],"d") for day,
Format([booking.ArriveDate],"m") for month, or
Format([booking.ArriveDate],"yyyy") for year.
 
Back
Top