home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!news.ans.net!cmcl2!adm!smoke!brl.mil!fsbrn
- From: fsbrn@brl.mil (Ferd S. Brundick)
- Newsgroups: comp.databases
- Subject: Re: menu
- Message-ID: <19587@smoke.brl.mil>
- Date: 21 Jan 93 16:02:54 GMT
- References: <1993Jan21.074103.1@helix.mgh.harvard.edu>
- Sender: news@smoke.brl.mil
- Reply-To: fsbrn@brl.mil
- Organization: Army Research Laboratory
- Lines: 33
-
- In article <1993Jan21.074103.1@helix.mgh.harvard.edu>, brousseau@helix.mgh.harvard.edu writes:
- |> I've encountered a problem with PAL that I need help with. Simply,
- |> how can I perform a query / endquery, using a string variable which
- |> contains operators?
- |> Example, I want to ask the user to input a (limited) range of
- |> days by checking a box either Y = Yes, include Monday or N = No,
- |> do not include Wednesday. I've gone through the response and
- |> made a string that would look something like this: "..MON.. AND NOT ..WED..",
- |> placed it into the query form, Database | ~string |, but it doesn't work.
- |> I think it is because the query is looking for a literal interpretation of
- |> the string, instead of parsing the data and operators. Anyone? The best I
- |> can think of at the moment is multiple queries, but that can take a _long_
- |> time. Thanks.
-
- Build your query the usual PAL way with Query/Endquery. Then stuff
- the pattern in the desired field with a field assignment statement.
- Suppose your field is named WorkDay and the string variable is
- WhichDays. The statement would be:
- [WorkDay] = WhichDays
- The variable WhichDays gets expanded, so you're putting the literal
- text in the query, not a tilde variable.
-
- I used this in a case where the user may optionally restrict a query
- to a certain value. I found out a tilde variable didn't work if the
- value was a null string -- pdox returned all the records with a null
- field (none). Instead I say
- IF NOT ISBLANK(InvCat) THEN [Category] = InvCat ENDIF
- btw, the field does not have to appear in the original query/endquery.
-
- dsw, fferd
- Fred S. Brundick
- USARL, APG, MD.
- <fsbrn@brl.mil>
-