473,657 Members | 2,571 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date Comparison in VB 6.0 and Access.. please help meee

3 New Member
hi.. i have a problem about date comparison in VB 6.0 and MS Access

i want to compare dates from access to a date from DTpicker control in VB 6.0.. this is my code but it doesnt work coz i get a syntax error..

"Select * from Reservations where DateCheckIn <= #date1# and DateCheckOut > #date1# and [RoomNo] = ' " & cmb_room & " ' "

"Select * from Reservations where #DateCheckIn# <= #date1# and #DateCheckOut# > #date1# and [RoomNo] = ' " & cmb_room & " ' "

notes:
DateCheckIn and DateCheckOut are access fields with Data Type "Date/Time"
date1 and date2 are Values from my two different DTpickers.
Reservations is my table name

both codes give me a syntax error.. can anyone please suggest a better code?

thnx a lot...
Oct 7 '09 #1
2 2712
smartchap
236 New Member
Visit below link for correction in query (syntax) (use "" before 7 after date1 & date2):
http://www.vbcity.com/forums/topic.asp?tid=32158
I think it will help you solve the problem.
Oct 8 '09 #2
mikkaro04
3 New Member
thnx a lot... this was very helpful... i kept on playing with the syntax.. thnx again..
Oct 13 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2972
by: Daniel Fisher | last post by:
Hi All! I'm fairly new to PhP and basicly trying to learn right now. Now I have a problem - I have a fairly large collection of movies which people keep borrowing from me. And then not returning. So I've put together an Access database with three tables - my media library, a list of friends and email addresses, and a borrow table which uses foreign keys from the other two tables to see who has borrowed what. Borrow Table also has two...
2
2267
by: Jon | last post by:
Hi, I am trying to pick up records from a date range without much luck. For my example below I am trying to pick up all records made in the last month. However none are being found (my code is tried and tested for all records). My database is in Access format. Field "datetime1" is of Date/Time data type getting the default value by using now() The relevant part of my code is as follows. Can anyone see what I'm doing wrong?
0
1901
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS Remoting and possible others. Keywords: VSS Remote Access, VSS Web Access, VSS Internet Access,
3
1937
by: Dino | last post by:
I am creating a website that is going to ask the user to enter a date! then from an access database get all records where a date field is greater then the date entered! Sounds simple, I do it in vb all the time! here is my sql line: Select * From Participants WHERE DateJoined > 01/14/07 ORDER BY TournamentID it updates fine with the date the user has entered! I know in vb I need to put ## around the date I am comparing! I tried...
3
11578
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not overlap existing records from the same table. I had this all working some time ago, but recently when I have gone back to do more testing, part of these validations no longer work. While there have been changes to the code in the meantime, I cannot...
3
6559
by: Karl Gibbon | last post by:
Hi There, I currently have a database in Access 2002 with several forms. I would like to restrict access to one form in perticular until November 1st every year. My current method (attempted method) is a heavy handed, no nonsense, direct date comparison using VBA. Function NovemberOnwards() 'Use with 'On Avtivate' on Orders form CurrentDate = Date 'I cannot decide which function is best to use
5
5677
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere 4.0, SourceOffSite 4.1, VSS Connect 1.5, SourceXT 2.1, VSS Remoting 2.5,
0
1418
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS Remoting and possible others. Keywords: VSS Remote Access, VSS Web Access, VSS Internet Access,
7
2768
by: mr.nimz | last post by:
hello, this is antenio. recently i've come to a problem. i got a way through it, somehow, still it left me in a curious state, so i'm posting it here, if i can get an answer from some techy, here is my table structure, Name: Table1
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8730
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.