Bryan
The only "special syntax" I know of is the use of the word "is" when using an operator such as <, >, etc. as I showed in my example.
Bill
---In MS_Access_Professionals@yahoogroups.com, <bmorris.gm@gmail.com> wrote:
Bill,
I've used case statements in other languages before and have found that each language has "special" syntax for proper operation. I was wondering if Access had any special "gotcha's" I needed to look for.
Sounds like it does not…so it is probably just a wrong sign or incorrect "if-then-else" in the body of a case statement.
Thanks,
B
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of wrmosca@comcast.net
Sent: Friday, December 06, 2013 11:22 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] RE: Case Statement
Bryan
Logically, a Select Case doesn't need to be in some kind of order unless you are doing something like (which is very bad practice)
Select Case myVariable
Case is < 5
Case is < 3
If myVariable = 2 the first Case would win even though the second Case is also true.
I've seen some common mistakes especially with age groups like 1-5; 5-10, 10-20. These all have overlapping ages. People who don't write code or write SQL statements don't see that flaw.
Regards,
Bill Mosca, Founder - MS_Access_Professionals
Microsoft Office Access MVP
https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E
My nothing-to-do-with-Access blog
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (8) |
Tidak ada komentar:
Posting Komentar