Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / April 2008

Tip: Looking for answers? Try searching our database.

Calculated value in a query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Denis - 17 Apr 2008 15:47 GMT
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
Beetle - 17 Apr 2008 15:56 GMT
DatePart("d", [ArriveDate])

DatePart("m", [ArriveDate])

DatePart("yyyy", [ArriveDate])
Signature

_________

Sean Bailey

> 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
[quoted text clipped - 7 lines]
>
> Denis
KARL DEWEY - 17 Apr 2008 16:02 GMT
>>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.  
Signature

KARL DEWEY
Build a little - Test a little

> 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
[quoted text clipped - 7 lines]
>
> Denis
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.