Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"or" statements

Status
Not open for further replies.

slwolf8

Technical User
Apr 23, 2001
82
US
This is kind of confusing I will try to be clear! I am writing this program for work that calculates due dates for tax payments for foreign countries. For instance, there are 15 countries. 7 of them have due dates at the anniversary of the patent filing date, and the rest give you until the end of that month. For instance if the filing date was August 3, 2000 then this years payment for the anniversary countries would be due August 3rd, 2003 and the end of the month countries would be due August 31st, 2003. The part I need help with is, I need to capture these due dates in a string based on which countries are chosen for tax payments. For instance if the user chooses to pay taxes in 4 countries (2 anniv. and 2 EOMonth) it would need to say August 3, 2003 and August 31, 2003. But if those 4 countries are all anniversary countries then it would just say August 3, 2003. I can't figure out how to cover all the possible combinations.
 
Hi slwolf8,

There are several ways to do it - the best one probably depends on how you have the data stored. How do you determine, for a single country, whether it is an aniversary country or an end-of-month country?

Loosely the pseudocode must be ..

Do for each selected country
Flag country type
Enddo
Select Anniversary flagged And EndOfMonth flagged
Case True And False
String = Anniversary Date
Case False And True
String = End-of-Month Date
Case True And True
String = Anniversary Date and End-of-Month Date
Case False And False
Probably an Error
End Select

But if the flags (or whatever else) are in a table you're querying anyway (is it Access of Excel?) then the actual implementation may be simpler.

Enjoy,
Tony
 
Well I actually have it hard coded in there, if country is selected then due date is this. I have a statement like that for each country. I'm sure there was a better way but that's how I did it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top