Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ms access query

Posted on 2016-09-08
5
Medium Priority
?
50 Views
Last Modified: 2016-09-08
Hi,

1. I'm trying set function between 'Start Date' and 'Finish Date'(with time) in query and it works fine:
between #01/09/2016 13:00:05# and #05/09/2016 21:11:30#

2. now I required to enter date. And function below works fine
between [Enter the Start Date:] and [Enter the Finish Date:]

3. How to enter date by setting specific default time?
I tried something like this and doesn't works for me...

between (DateValue([Enter the StartDate:]) & TimeValue("13:00:05")) And #05/09/2016 21:11:30#

between (Format([Enter the Start Date:],"dd/mm/yyyy") & "13:00:05") And (Format([Enter the Finish Date:],"dd/mm/yyyy") & "21:11:30")

Can you advise on this please...

Thanks
0
Comment
Question by:Darius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 51

Accepted Solution

by:
Gustav Brock earned 2000 total points
ID: 41789708
It could be:

Between DateValue([Enter the StartDate:]) + TimeSerial(13, 0, 5) And DateSerial(2016, 9, 5) + TimeSerial(21, 11, 30)

/gustav
1
 

Author Comment

by:Darius
ID: 41789732
Thank you very much! This is exactly what I need and it's works....
0
 
LVL 51

Expert Comment

by:Gustav Brock
ID: 41789747
You are welcome!

/gustav
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 41789789
You original syntax would have worked too if you had used the + operator instead of the ampersand.
DateValue([Enter the StartDate:]) + TimeValue("13:00:05")

Ron
1
 

Author Comment

by:Darius
ID: 41789804
Perfect it's works as well, thank you
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question