Article View: borland.public.vdbase.data.sql
Article #1515Re: SQL in V7 parameter passing
From: Ken Mayer
Date: Thu, 18 Dec 1997 00:00
Date: Thu, 18 Dec 1997 00:00
29 lines
1684 bytes
1684 bytes
Mike McGlothlin wrote:
>
> I have hundreds of reports created in crystal that use one of four var.
> (j1,j2,j3,j4) to select the records to print. I have converted all the
> reports to the new report styles and all my select criteria are out the
> windows but the col. and formula were translated. A SQL is also created
> that "select *". If I could pass a parameter to the where cause then I
> could have all my reports fix in no time The book(&help file) only
> reference to passing parameter is to "where fieldvar = :var1" no examples
> any where else. I can not get the SQL designer to except a parameter.
Mike -- don't use the sql designer for this.
Instead, try just using a straight query or data module. Then, check to
see the type of the memvar (to make sure it exists) in the onOpen for
the form or report:
if type( 'var1' ) # "U" // not undefined
form.queryname1.sql = "select * from tablename where "+;
"fieldname = '"+var1+"'"
endif
(Note -- use the single quotes if this is either a date or a character
value)
Hope this helps a little.
Ken
Technical Details
Message-ID:
<34997B40.13A9@corp.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<01bd0be5$06dff9c0$67731fce@ceo>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,5a88705e5f237252 X-Google-Attributes: gidff5a1,public From: Ken Mayer <kmayer@corp.borland.com> Subject: Re: SQL in V7 parameter passing Date: 1997/12/18 Message-ID: <34997B40.13A9@corp.borland.com> X-Deja-AN: 299419419 Content-Transfer-Encoding: 7bit References: <01bd0be5$06dff9c0$67731fce@ceo> Content-Type: text/plain; charset=us-ascii Organization: Borland, International Mime-Version: 1.0 Reply-To: kmayer@corp.borland.com Newsgroups: borland.public.vdbase.data.sql