Text Message in Query

andthe

New Member
Joined
Sep 26, 2003
Messages
25
I'm fairly new to Access and would appreciate some help. I have a query that contains PART, BUYER, PO, BEG_DATE, END_DATE, REQD_DATE. I want all of these fields displayed, but I also want to create a new column called ERROR. If the BUYER = 99 or the BEG_DATE is overdue or the END_DATE is overdue I want the field to display "ERROR - CHECK STATUS". How do I do this within Access? Thanks!!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hullo! Try something along these lines:
Code:
Error: Iif(BUYER=99,"Error - Chech Status",Iif(BEG_DATE>overduecalc,"Error - Check Status",Iif(END_DATE>overduecalc,"Error - Check Status",Null)))
The phrase "overduecalc" is whatever logic you are going to use to determine overdue status. That should get you started.

HTH (y)

P
 
Upvote 0
Create a calculated field in your query with a formula something like:

Code:
ERROR: IIf(([BUYER]=99) Or ([BEG_DATE]<Now()) Or ([END_DATE]<Now()),"ERROR - CHECK STATUS","")

Simply paste this code in a blank Field box in Design mode of your query.

I am checking the dates to see if they are before today. You may need to modify that calculation depending on what your conditions for "past due" are.
 
Upvote 0

Forum statistics

Threads
1,215,053
Messages
6,122,882
Members
449,097
Latest member
dbomb1414

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