• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 381
  • Last Modified:

TimeValue Criteria

Hi all,

I have a query that extracts the Time portion of a date/time field using TimeValue([Field]).

How do I specify the criteria now on that extracted portion to give me only the returned values of 12:00:00AM?

I have tried #12:00:00 AM# and TimeValue("12:00:00 AM") and all i get is data mismatch?

Thanks
Sean
0
SeanNij
Asked:
SeanNij
  • 5
  • 2
1 Solution
 
mbizupCommented:
Try this -

Subtract the integer part of the time, and convert back.

For the current date/time:

cdate(now() - int(now()))
0
 
mbizupCommented:
Or for a date/time field:


cdate(YourDateTimeField - int(YourDateTimeField))
0
 
mbizupCommented:
You can also use the Format function:

Format(YourDateTimeField, "hh:nn:ss")
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
SeanNijAuthor Commented:
I am already extracting the time portion. I want to know what to use in criteria for 12 am.
0
 
mbizupCommented:
Sorry - I think I totally misread your question.  

Give this a try for criteria to just return records with 12:00:00 AM as the time part:

WHERE TimeValue(YourField) = "12:00:00 AM"


(The where clause in SQL view)
0
 
SeanNijAuthor Commented:
HAH! That works!
Thankyou!!!
0
 
mbizupCommented:
Glad to help out -

Sorry about all the earlier posts.  Need more caffeine.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now