473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

date filter not working

I'm trying to put a filter into some forms or filters but the filter
donīt work properly.

I'm using the format dd-mm-yyyy. The forms and the tables always shows
how dates in that format. But when i put filters i donīt get the
expected res result in fact some times i donīt get any result.

I al ready try this filters

date = #08/05/2006#

date <= #08/05/2006#

date between #07/05/2006# and #09/05/2006#

i al ready try use # format(08/05/2006, "dd-mm-yyyy") # in each filter
and still don't work.
I hope you can help me
thanx

May 23 '06 #1
3 7328
chucher wrote:
I'm trying to put a filter into some forms or filters but the filter
donīt work properly.

I'm using the format dd-mm-yyyy. The forms and the tables always shows
how dates in that format. But when i put filters i donīt get the
expected res result in fact some times i donīt get any result.

I al ready try this filters

date = #08/05/2006#

date <= #08/05/2006#

date between #07/05/2006# and #09/05/2006#

i al ready try use # format(08/05/2006, "dd-mm-yyyy") # in each
filter and still don't work.
I hope you can help me
thanx


Date literals in Access queries/filters must use US format, ISO format, or an
unambiguous format where the month uses alpha characters. Your regional
settings and internal format settings do not matter.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
May 23 '06 #2
There's not nearly enough information here to come to a decision on what's
wrong. What data type field is used to store the dates. Are you storing
dates in a table? How are you trying to filter? More info please.
May 23 '06 #3
I change it to US format and it seems to work fine thanx

this is the complete code Iīm using to open another form and and
filter the information

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "invoice"
stLinkCriteria = ""

If (Not IsNull(txtDate) And IsNull(txtEndDate)) Then
'format(txtDate, "mm-dd-yyyy")
If (stLinkCriteria <> "") Then
stLinkCriteria = stLinkCriteria & " And "
End If
stLinkCriteria = stLinkCriteria & "date = #" & Format(txtDate,
"mm-dd-yyyy") & "#"
End If
If (IsNull(txtDate) And Not IsNull(txtEndDate)) Then
If (stLinkCriteria <> "") Then
stLinkCriteria = stLinkCriteria & " And "
End If
stLinkCriteria = stLinkCriteria & "date <= #" &
Format(txtEndDate, "mm-dd-yyyy") & "#"
End If
If (Not IsNull(txtDate) And Not IsNull(txtEndDate)) Then
If (stLinkCriteria <> "") Then
stLinkCriteria = stLinkCriteria & " And "
End If
stLinkCriteria = stLinkCriteria & "date BETWEEN #" &
Format(txtDate, "mm-dd-yyyy") & "# And #" & Format(txtEndDate,
"mm-dd-yyyy") & "#"
End If
If (Not IsNull(cmbClient)) Then
If (stLinkCriteria <> "") Then
stLinkCriteria = stLinkCriteria & " And "
End If
stLinkCriteria = stLinkCriteria & "idClient = " & cmbClient
End If

Debug.Print stLinkCriteria

DoCmd.OpenForm stDocName, , , stLinkCriteria

May 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: BlackFireNova | last post by:
I need to write a report in which one part shows a count of how many total records fall within the working days (Monday - Friday) inside of a (prompted) given date range, in a particular...
1
by: DD | last post by:
I have the following code, The user needs to search by any date they enter into a searchbox, my code is not working! Can someone give me a hint or?? Regards Code Private Sub cmdFind_Click()...
2
by: DD | last post by:
The user needs to search by a date they enter into the searchField my code is NOT working can anyone advise where i am going wrong please Regards DD Private Sub cmdFind_Click() Dim...
4
by: Stewart Allen | last post by:
I'm trying to filter a table that has 2 date fields, the first date will always have a value but the second will only occasionally has a value. Each date field also has a corresponding text field...
3
by: Gerry Abbott | last post by:
Hi all Im in Ireland, so date format is always dd/mm/yy. It trying use query as a filter for a recordset, containing a date field, SELECT tblInspections.InspDate FROM tblInspections WHERE...
2
by: MajorTom | last post by:
Hello everybody I using an dataview rowfilter expression to filter some record from one dataset, is I only working with the date portion no problem, but how do I use the date and the time for...
6
by: fonzie | last post by:
Is there any way to include two unbound text boxes (for a start date and end date) to a filter-by-form? The users may want to filter by several different fields and they may want to include a date...
3
by: randy1200 | last post by:
I have a DataView (dv) that includes a StartDate DateTime column. I'd like to return the DataView record that contains a StartDate value closest to my IncidentDate value: string filter =...
12
smithj14
by: smithj14 | last post by:
I have a form to enter start and end dates then select a worker name to filter a report. This all works fine and when the report is open in preview mode it shows the date range in the txtboxes on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.