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!!
 

Some videos you may like

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Philem

Active Member
Joined
Jan 2, 2003
Messages
282
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
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,974
Office Version
  1. 365
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,303
Messages
5,600,857
Members
414,407
Latest member
Zaner0445

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
Top