Extracting data from a query (1 Viewer)

Jass7869

Registered User.
Local time
Today, 11:18
Joined
Aug 12, 2014
Messages
96
SELECT tblLeaveBalance_Cashables1.Facility, tblLeaveBalance_Cashables1.Division, tblLeaveBalance_Cashables1.Position, tblLeaveBalance_Cashables1.Name, tblLeaveBalance_Cashables1.[Class Code], tblLeaveBalance_Cashables1.Class_Title AS Classification, tblLeaveBalance_Cashables1.CBID, tblLeaveBalance_Cashables1.[SS Months], tblLeaveBalance_Cashables1.Age, tblLeaveBalance_Cashables1.BasePay, tblLeaveBalance_Cashables1.[Hourly Rate], tblLeaveBalance_Cashables1.[Annual Leave], tblLeaveBalance_Cashables1.[AL Total $], tblLeaveBalance_Cashables1.[Personal Holiday], tblLeaveBalance_Cashables1.[Personal Holiday (Hours)], tblLeaveBalance_Cashables1.[PH Total $], tblLeaveBalance_Cashables1.Vacation, tblLeaveBalance_Cashables1.[VA Total $], tblLeaveBalance_Cashables1.[Total Hours], tblLeaveBalance_Cashables1.[Total Hours $]
FROM tblLeaveBalance_Cashables1
WHERE (((([Vacation]>640) or ([Annual Leave]>640)) And ([Personal Holiday (Hours)]>24)) AND ([tblLeaveBalance_Cashables1].[CBID]) In ("M06") and ("S06") and ("R06")

I need to extract data that where vacation time is >640 or annual leave is >640 and where personal Hol hours are >24 and CBID is M06,S06 and R06.

How do I write my where clause?? Help
 

CJ_London

Super Moderator
Staff member
Local time
Today, 19:18
Joined
Feb 19, 2013
Messages
16,627
and CBID is M06,S06 and R06.
I presume you mean OR, since CBID can't be all of these at the same time

What AccessRookie means is

[tblLeaveBalance_Cashables1].[CBID] In ("M06","S06","R06")

Note your bracketing incomplete so this query will generate an error at the moment
 

Jass7869

Registered User.
Local time
Today, 11:18
Joined
Aug 12, 2014
Messages
96
Hello,

CBID is a field and I am trying to pull M06, S06 and R06 out at the same time.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 19:18
Joined
Feb 19, 2013
Messages
16,627
well you have your answer - does it do what you want?
 

Users who are viewing this thread

Top Bottom