TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mayank Jani
NA
477
76.6k
To find records between two dates.
Sep 16 2017 9:56 AM
Dear All,
Greetings of the day.
I am working on an application named Hotel Management and it is about to keep all the records from guest check-in to check-out. I am using VS2008 and MS Access as database.
while running a report of guest checkin, i found some problem. the report runs but does not show the correct result. there are two datetimepickers, one command button and one data grid view.
>the guests checked in between 01/07/2017 and 18/07/2017
>when i select dates between 01/07/2017 and 09/07/2017, it shows all the records beyond 09/07/2017.
>when i select dates between 01/07/2017 and 05/07/2017, it shows messagebox 'No Record Found'.
my query is...
OleDbDataAdapter DateRecord = new OleDbDataAdapter("Select * From Guests Where CheckIn Between #" + dtpFrom.Value.Date.ToShortDateString() + "# AND #" + dtpTo.Value.Date.ToShortDateString() + "#", myconn);
if i put dtpFrom.Value.Date.ToShortDateString() instead of dtpTo.Value.Date.ToShortDateString(), it shows no record for any criteria.
Kindly help to let me know where i am mistaking.
Please see the screen shots for more clarification, if required.
Thank You,
Mayank Jani
Attachment:
Report.zip
Reply
Answers (
2
)
I Am Setting Adds In Universal Windows Project ?
Create a common class so that we can make insert,update easy