query formula

bwlytkr

Board Regular
Joined
Jun 8, 2012
Messages
175
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Would someone please help me convert this excel formula to use in a query. Below is the info. Any help would be appreciated. Thanks

=IF(AND(H2="YES"),IF(AV2>=$BK$2,"YES","NO"),IF(H2="NO","NO"))

The name of this column will be PSC Ticket. H2= LU company column, AV2 = the NTG Start Date Column , and BK2 = a finite date of 6/29/21.

NTG Start Date Column looks like this in the query / LU Company Column Look Like this in the query

Field: NextToGoStartDate / LU Company?: IIf(Left([NJUNS MEMBER]![NAME],4)="Gulf","Yes","No")
Table: ALFN NTG / This field is blank
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Not sure where that access formula came from. Sorry for the confusion.

=IF(AND(H2="YES"),IF(AV2>=$BK$2,"YES","NO"),IF(H2="NO","NO"))

The name of this column will be PSC Ticket. H2= LU company column, AV2 = the NTG Start Date Column , and BK2 = a finite date of 6/29/21.

NTG Start Date Column looks like this in the query / LU Company Column Look Like this in the query

Field: NextToGoStartDate / LU Company?:
Table: ALFN NTG / This field is blank
 
Upvote 0
How are you handling the absolute reference $BK$2 in your table?

And what are your field names?
 
Upvote 0
How are you handling the absolute reference $BK$2 in your table?

And what are your field names?
Field names and table names are at the bottom of the message. Mextogostartdate is one and Lu Company? Is the other. Table names are below those. The date is in cell nw2 of the excel spreadsheet.
 
Upvote 0
Well then it's mostly a simple replacement with the consideration that Access has IIF() instead of IF() and requires # # around literal date values.

SQL:
IIF([LU company]="YES",IIF([NTG Start Date ]>= # 6/29/21 # ,"YES","NO"),IIF([LU company]="NO","NO"))
 
Upvote 0

Forum statistics

Threads
1,215,143
Messages
6,123,285
Members
449,094
Latest member
GoToLeep

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