473,769 Members | 3,102 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set criteria to find date records for this coming weekend

52 New Member
Hey guys, i have this code:

Expand|Select|Wrap|Line Numbers
  1. SELECT * 
  2. FROM QueryCases 
  3. WHERE Weekday(QueryCases.StartDate) In ('1','7') AND QueryCases.Completed = False 
  4. ORDER BY QueryCases.StartDate;
  5.  
the WHERE Weekday(QueryCa ses.StartDate) In ('1','7') returns any weekend records, how do i set criteria to only show weekend records for this coming weekend. Thanks in advance
Dec 14 '07 #1
3 1913
Rabbit
12,516 Recognized Expert Moderator MVP
Please use code tags.

This gives you the next saturday.
Expand|Select|Wrap|Line Numbers
  1. Date() + 7 - Weekday(Date())
  2.  
Add one to that and it'll give you the next sunday.

If it's saturday it'll give you that date.
If it's sunday it'll give you next week.
Dec 14 '07 #2
darnnnel
52 New Member
Amazing. thanks a million!
Dec 14 '07 #3
Rabbit
12,516 Recognized Expert Moderator MVP
Not a problem, good luck.
Dec 14 '07 #4

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

Similar topics

5
1036
by: Salad | last post by:
This may occur to you in the future. You want to get the min or max of a field that you set criteria on...maybe for a combo box. Let's say you wanted to get the minimum of all date fields where the date field is in the future. If you use the query builder and don't modify the results you end up with zero records. Ex. SELECT Min(DateField) AS MinDate FROM Table HAVING Min(DateField) > Date()+1
1
371
by: April | last post by:
I am working on a database to be used for auditing medical groups. TABLE:DETAILS contains these fields: (autonumber) 50 group fields through each a combo box that pulls from the same list of 100+ groups Each group is audited by reviewing 10-20 patient records. This
1
1240
by: Jonny | last post by:
Hello, I have a list box which displays the date from and date to of each of my records. I also on my form, have a date from and date to box at the top. Both of these are unbound, and are to be used as criteria options. For example, if I enter 01/05/2004 in the From Date and 01/06/2004 in to To Date, I only want the list box to display the records between thesedates.
5
5163
by: DW | last post by:
I have a query in Access 2003 that has the following criteria SELECT tblOrder.SessionDate, tblMenus.Item_Name, tblOrder.Type, Format$(tblorder!SessionDate,"Short Time") AS SessionTime, Sum(tblMenus.Item_Quantity) AS MenuCount INTO tblSessionQuery FROM tblOrder, tblMenus WHERE (((tblOrder.Order_ID)=.) AND ((Format$(!,"mm/dd/yyyy")) Between Format$(!!,"mm/dd/yyyy") And Format$(!!,"mm/dd/yyyy")))
4
4035
by: EJO | last post by:
In the query builder, I can create a query that will take a date/time as criteria, and the query finds the records: SELECT SRSrvcsEquip.Stock, SRSrvcsEquip.Activity, SRSrvcsEquip.EquipOwned, SRSrvcsEquip.Manufacturer, SRSrvcsEquip.EHSN, SRSrvcsEquip.Qty, SRSrvcsEquip.PartNumber, SRSrvcsEquip.Description, SRSrvcsEquip.ListType, SRSrvcsEquip.Site_ID, SRSrvcsEquip.SR_ID, SRSrvcsEquip.ListDate, SRSrvcsEquip.ID FROM SRSrvcsEquip WHERE...
10
3279
by: Daniel | last post by:
In Microsoft Access I can write a query that includes the criteria: Between Date()-7 And Date() to retrieve the records from a table that fall within the last week. I'm trying to write a procedure to do this in VB.NET (2005 Express Edition). But I always get the message that the Jet database engine does not recognize the syntax (of the Date function I assume). I've also tried Now() and it works but only by itself. I seem to add or
2
5738
by: Mark Roughton | last post by:
I have a form where the users need to view records for various criteria, one of which is a date field on which they may wish to view all related data for the selected date, for all dates upto and icluding the selected date or all records on or after the selected date The user selects either "=", >=" or "<=" from a combo box and then a date from another combobox. The combination of thse two choices is then set in an unbound textbox so...
13
13049
newnewbie
by: newnewbie | last post by:
I have an Access database that I upload a data extract intoto daily. I want to create a query that will give me a list of dates that no data can be found for. E.g. there are no records created on the weekends, hence weekend dates will be in the list generated by this query. By creating such a query I want to ensure integrity of my data, e.i.looking at this query from time to time will give me an idea that on such and such date I might have...
8
2781
by: Dr Al | last post by:
I have a table with four date fields, some of which may not be filled in based on our data entry needs. I have a criteria set as <date()-180 which is supposed to pull dates older than 180 days ago. The problem is that when I use that criteria for all four fields I am not getting the expected results. I am trying to find out from this query is the date in date field one is older than 180, same thing for the other three date fields. For...
0
9589
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
9423
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
10222
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
10050
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
7413
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
6675
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
5310
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...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3570
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.