Need to Convert this Formula to an Access Database...

prabha_friend

Board Regular
Joined
Jun 28, 2011
Messages
95
=IF(OR(WEEKDAY(CX1480,2)=6,WEEKDAY(CX1480,2)=7,COUNTIF('C:\Documents and Settings\karuppsp\Desktop\My Projects\SLA - C11\[Holiday Calendar FR Freight.xlsx]Holiday Calendar FR Freight'!$D$5:$D$14,CX1480)>0),TRUE,FALSE)


I have created the Holiday Calendar in a table named Holidays. I know I have to use a subquery here but I haven't used it before. Please help. I have created the following column in a query with the following expression:

Ap Inquiry: IIf(Weekday([Received Date],2)=6 Or Weekday([Received Date],2)=7 Or (Subquery Here),True,False)

Thanks in advance...
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I think in an expression using aggregate function DCount() is simplest.
IIf(Weekday([Received Date],2)=6
Or Weekday([Received Date],2)=7
Or DCount("FieldName","Holidays","[FieldName] = #" & [Received Date] & #"),True,False)

I have used FieldName as the name of the field with dates in your holidays table. Edit that as needed. Remember that in the "criteria" field of the DCount function you are trying to build a string with concatenation. It needs to end up being something like "[FieldName] = #1/1/2014#", which is an expression that the formula can understand (date literals are enclosed in hashes). Therefore your DCount formula is in the form DCount("fieldname", "tablename", "criteria").

I probably won't be back today - if there's any problems post back and others can also help.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,390
Members
448,957
Latest member
Hat4Life

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