home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / 9278 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  2.1 KB

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