Hi
i want to retieve all the records of a particular date where date is specifiedin mask edbox
i have writtencode lie this
rssearch.Open "select * from timesheet where date1= #" & mskfrom.Text & "#", con, adOpenDynamic, adLockOptimistic
but it does not work though the specified date is pesent in ms- access table
7 972
Hi
i want to retieve all the records of a particular date where date is specifiedin mask edbox
i have writtencode lie this
rssearch.Open "select * from timesheet where date1= #" & mskfrom.Text & "#", con, adOpenDynamic, adLockOptimistic
but it does not work though the specified date is pesent in ms- access table
You need to format you date for access; May be in a variable and then pass in query
fromdate = Format$(mskfrom.Text , "m/dd/yy")
Try to use dtpicker instead of masked control, and format the date as per database format before passing to SQL string.
Is this useful/effective to use datepicker for applications that are not allowed to use pointing devices?
"select * from timesheet where date1= #" & mskfrom.Text & "#" .
Why not try formating both dates like this,
"select * From timesheet where Format(Date1,'yyyymmdd') = " & Format(mskfrom.Text ,'yyyymmdd')
... "select * From timesheet where Format(Date1,'yyyymmdd') = " & Format(mskfrom.Text ,'yyyymmdd')
Generally speaking, it's not a good idea to use a function in the WHERE clause. It may not matter if the database is small, but for a large one, no way!
You force the DBMS to read every record and format the value, just to decide whether to read the record. :(
Also, in this example I think you'd need single quotes around the test value.
Something else to keep in mind. Is it actually a date value stored in the field, or a date and time?
Let's say the database record has 1/1/2007 13:53:28 in the field. If you search for 1/1/2007 I would not expect it to match.
In such a case you might have to consider options such as... - Use a range, such as Between #m/d/y 00:00:00# and #m/d/y 23:59:59#.
- Use a function (yes yes, I know what I said...) to look at just the date, without the time.
Of these two, obviously you'd expect the range to be more efficient, based on what I mentioned above.
Is this useful/effective to use datepicker for applications that are not allowed to use pointing devices?
You mean to say want to use only textbox and buttons and nothing else ?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Laurence Neville |
last post by:
This is regarding a change in the Short Date format under Hebrew Regional
Settings, that has caused huge problems in our ASP web application. The
change appears to have been introduced sometime...
|
by: martini |
last post by:
Need help:
I am trying to call a DB2 stored procedure that requires parameters: 4x int,
date, varchar, int. I use VB6 & oledb.
I'm using statements:
cmd.CommandText = "{call db2admin.proc(1, 0,...
|
by: David B |
last post by:
I have 2 querys with the following in the date criteria
Between DateAdd("m",-6,(!!)) And
(!!)
Between DateAdd("m",-24,(!!)) And
DateAdd("m",-6,(!!))
Problem is they both look at the same...
|
by: Dustin Wilson |
last post by:
I have a problem with the following line of code.
rstOutput! = FormatDateTime("January 1, 2004", vbLongDate)
When I run this on my computer at home it runs without problem but when I
run it at...
|
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...
|
by: Julie Wardlow |
last post by:
Help!
I am calculating a future date using the DateAdd function in a query (the
calculation also involves an IIf statement), and have managed to get this
formula to produce the required result....
|
by: TN Bella |
last post by:
Hello,
I was looking through the older posts for a solution to this problem,
but I am still confused on how to fix my problem. There are two dates on
my form, one (txtInvDate) is entered by the...
|
by: James P. |
last post by:
Hello there,
In my asp.net page using VB, I have a date text field in mm/dd/yyyy
format. When a date is entered, I'd like to validate it to make sure
the date is greater than or equal to the...
|
by: Jim Armstrong |
last post by:
Hi all -
This problem has been driving me crazy, and I'm hoping the answer is
something stupid I am neglecting to see....
The procedure posted below is part of an Access/SQL database I have...
|
by: creative1 |
last post by:
Hello everyone.
I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this.
The problem is:
I want to print account statement (or any other...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
| |