date/time stamp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mcgr0199
    New Member
    • Aug 2009
    • 3

    date/time stamp

    How do I separate a date/time stamp in Access 2007? I need to be able to query for certain times of day over a period of 120 days (i.e. create a query that only gives me the data for 1pm, irrespective of the date). Any suggestions?
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    In VBA code:
    DatePart("h",Da teTimeField)

    Or in a Query:
    DatePart("h",[DateTimeField])

    will retrieve the hour.

    The general syntax is

    DatePart("Inter val",DateTimeFi eld)

    To retrieve other components, use these as the Interval

    yyyy Year
    q Quarter
    m Month
    y Day of year
    d Day of Month
    w Weekday
    ww Week
    h Hour
    n Minute
    s Second

    Comment

    Working...