473,793 Members | 2,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dates problem

121 New Member
Hi all
i have access databae in which a table consists of all staff details with dat now if want to retrieve records between 5/01/2008 to 10/01/2008.i dot know the syntax of using between query can u pls help
Jan 12 '08 #1
5 1182
QVeen72
1,445 Recognized Expert Top Contributor
Hi all
i have access databae in which a table consists of all staff details with dat now if want to retrieve records between 5/01/2008 to 10/01/2008.i dot know the syntax of using between query can u pls help
Hi,

Check this :

SELECT * From MyTable Where MYDate Between #05-01-2008#
And #10-01-2008#

Regards
Veena
Jan 12 '08 #2
charvi
121 New Member
rs.Open "select * from timesheet where date between #" & mskfrom & "#" And "# & mskTo & #", con, adOpenDynamic, adLockOptimisti c

I have written this ode but it giv me runtime error.
pls help
Jan 13 '08 #3
charvi
121 New Member
rs.Open "select * from timesheet where date between #" & mskfrom & "#" And "# & mskTo & #", con, adOpenDynamic, adLockOptimisti c

I have written this ode but it giv me runtime error.
pls help
when writethis code it gives all the records..e if i want to search between 2/01 and 5/01 igives me al recordsof 6/1 ,7/01 so on
Jan 13 '08 #4
charvi
121 New Member
when writethis code it gives all the records..e if i want to search between 2/01 and 5/01 igives me al recordsof 6/1 ,7/01 so on
i getthis dateproble when i enter in the form of mm/dd/yyyy in mskedbox1 though i have formatted maskedbox as dd/mm/yyyy why is it pls help
Jan 13 '08 #5
Killer42
8,435 Recognized Expert Expert
i getthis dateproble when i enter in the form of mm/dd/yyyy in mskedbox1 though i have formatted maskedbox as dd/mm/yyyy why is it pls help
You need to show us the exact string which is being passed to Access. The fact that the masked edit control shows something in a particular format on the form doesn't tell us anything about what you're getting out of it.

Pretty sure Access demands U.S. date format (MM/DD/YYYY) so the syntax should be something like...

SELECT * From MyTable Where MyDate Between #01/05/2008# And #01/10/2008#

Alternatively, you might avoid the date format issue by using an unambifuous format. That is, one in which the month and day cannot be confused. For example...

SELECT * From MyTable Where MyDate Between #05-Jan-2008# And #10-Jan-2008#
Jan 13 '08 #6

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

Similar topics

4
2413
by: F | last post by:
Hi I have posted the question few days back about problem in inserting the dates in SQL server and thankful to them who replied. That was solved and this is a nice solution. http://www.aspfaq.com/show.asp?id=2023 Now I am facing another problem. I have to get data between two dates. That dates user has to provide and in
5
2144
by: PW | last post by:
<rant> Sorry guys, but I just have to whinge. Dates in ASP are a total pain in the butt! I seem to get caught out so many times. I realise its my own fault, but going from the posts in this newsgroup and others, I'm not the only one. Its just a poorly addressed issue within ASP. So for all your poor buggers out there that are having problems, particularly with european date formats, here is my solution. I have the user enter their...
7
12815
by: Bambero | last post by:
Hello all Problem like in subject. There is no problem when I want to count days between two dates. Problem is when I want to count years becouse of leap years. For ex. between 2002-11-19 2003-11-19
7
5126
by: smcgouga | last post by:
Visual Basic 6. ADO 2.8 I have an as400 DB2 V5R1 datasource. Dates are defined as *ISO format and have a range from '0001-01-01' to '9999-12-31'. I am trying to update a date field on the database with a value of '0001-01-01' (*LOVAL) The problem is that I need to use ADO cursors and can not use the SQL update command: "update tbl set dateField = '0001-01-01 where ..." (note this works no problem)
3
2459
by: SJH | last post by:
I currently have reports (mostly graphs) that utilize dates entered into a form. The dates are pretty baisc from the standpoint of the start and end of the current fiscal year, the start and end of last fiscal year, previous month start and end dates, etc. My users would like to enter one set of dates (preferably the previous month start and end) and have all other dates update from there without extra input. I have the fiscal years...
1
2147
by: Likhith Areekkal | last post by:
Hi, Language: C#, asp .net application This is a room reservations web application. I have two Calendars on my website: Calendar1 & Calendar2 Calendar1 shows the current month and Calendar2 shows the next month. The clients are allowed to do the reseration (if any room(s) is/are available) for the next 15 days starting from the current date.
12
2447
by: Dixie | last post by:
I am trying to calculate the number of workdays between two dates with regards to holidays as well. I have used Arvin Meyer's code on the Access Web, but as I am in Australia and my date format is dd/mm/yyyy, I have found that the dates I put in my holidays table are reversed into American dates. So, the wrong holiday dates are subtracted from the total workdays between the start and end dates. Is there an easy fix for this? ******Code...
2
2198
by: Jim Carlock | last post by:
(1) Does PHP provide any way to handle dates prior to 1980? I know there's problems with Microsoft Windows NT and all Windows NT operating systems will allow a date prior to 1980 to be placed upon a file, but it ends up not being able to display the date (probably an Windows Explorer specific issue). (2) I'm looking for for ways to store dates and process dates (dates only). This probably ends up as a database specific issue, so I'm...
5
50583
by: jorgedelgadolopez | last post by:
Hi all, I am using the xpathnavigator evaluate function on .net (xpath 1 right?). Now I need to expand the code to do multiple contains, compare dates (such as 'before', 'between' and 'after'), and so on. This is the thought: //person
5
2137
by: Dave | last post by:
Hello, I have a possible problem exporting a text field that happens to contain dates (but is not a date field) when using TransferText in MS Access 2000. I am exporting a query to a text file using TransferText in a module. One of my fields is a text field called "invoice description". This field may include any content including dates (e.g., 01/01/2006, 1/1/2006, 01/01/06, Invoice #1, Jan 2006, 293842, etc. are all
0
9671
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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
10433
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
10212
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
10161
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,...
1
7538
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
6777
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();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.