Article View: borland.public.vdbase.data.sql
Article #785Help with SQL and memory variables.
From: Craig Cohernour
Date: Sun, 19 Jul 1998 00:00
Date: Sun, 19 Jul 1998 00:00
56 lines
2306 bytes
2306 bytes
I'm extremely new to this fancy SQL stuff so please be patient ....
I'm trying to set up a report in which the query object/statement needs
to reference dates stored in memory variables. My specific problem is
this:
The variables are public and are being picked up on a form just prior to
running the report.
The relationship between the two tables involved seems great, I simply
don't know how to reference the memory variable in the sql statement or
in
the visual sql tools.
Definitions:
m_begdate (variable) = Starting date for record inclusion.
(date-type)
m_enddate (variable) = Ending date for record inclusion.
(date-type)
m_progid (variable) = Program identification number
(2digit/character-type data.)
st_prodate (field) = Date of medical procedure.
(Sterilization table/date-type)
st_dte_con (field) = Date of consent signature.
(Sterilization table/date-type)
st_stat (field) = Status of the current application for this client.
(Sterilization table/character type)
Samples: 1-Active, 2-Cancelled, 3-Denied, 4-Expired
cl_dob (field) = Client's date of birth.
(Client table/date-type)
The criteria that I need help setting up an SQL
statement for is (or preferably using the visual tools):
STERILE->ST_PRODATE must not be blank.
STERILE->ST_PRODATE must be equal to or greater than M_BEGDATE.
STERILE->ST_PRODATE must be equal to or less than M_ENDDATE.
STERILE->ST_DTE_CON minus CLIENT->CL_DOB must be equal to or greater
than (21*365.25).
STERILE->ST_PRODATE minus STERILE->ST_DTE_CON must be greater than
29. (30 or more)
STERILE->ST_STAT must equal "1".
Can you help me?
Thanks,
Craig
Technical Details
Message-ID:
<35B1A9AF.8788721@access.mountain.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,d29952a1b56f8d15,start X-Google-Attributes: gidff5a1,public From: Craig Cohernour <cohe106w@access.mountain.net> Subject: Help with SQL and memory variables. Date: 1998/07/19 Message-ID: <35B1A9AF.8788721@access.mountain.net> X-Deja-AN: 372831457 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.vdbase.data.sql