How to Create a Querry

Hashiru

Active Member
Joined
May 29, 2011
Messages
286
Hello all,

I am new to Access, but I have to setup a querry to give me the result of the lowest dates from three fields for one querry and for the other querry I want the querry to return a range of values between two dates for three fields using Or operator.

Querry 1

Code:
Field 1       Field 2     Field 3   Required Result in Querry

1/2/13     2/2/13     3/3/13     1/1213


Querry 2

Code:
Field 1       Field 2     Field 3
1/2/13       2/3/13     3/3/13
4/2/13       5/3/13     6/3/13
8/2/13      7/3/13      7/14/13


Criteria for Querry 2: for each field the date must be Between 2/1/13 And 6/30/13 and one field is independent of the other (in other words the combination for field 1 to field 3 should be Or)

Requested Result for Querry 2

Code:
Field 1      Field 2      Field 3

1/2/13     2/3/13       3/3/13
4/2/13      5/3/13      6/3/13

For Querry 2 I have tried using Between[Start Date] And [End Date] on field1 on the criteria row, field 2 on the Or row and Field 3 the row after the Or row.


Thanks in advance.
 
Last edited:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Q2, you have it partially right, but
on line 1 of critera field1: Between[Start Date] And [End Date]
BUT I think you want..
on line 2 of critera but field2, the same thing: Between[Start Date] And [End Date]
on line 3 of critera but field3: Between[Start Date] And [End Date]

each between is on a diffent line (not all 3 on the same line)
It will look like stair step.

Now Q1
If you want the lowest date 'separately' for the 3 fields, youd have to make 3 queries to pull the min([date]) of that column.
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top