By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,484 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

Parameters in a SELECT DISTINCT doesnt work

P: n/a
Hi,

here my problem, i use stored procedure in ACCESS database(latest
version), and i would like to use this procedure but it doesnt work,
do you know why ?
Procedure:
PARAMETERS MyField Text ( 255 );
SELECT DISTINCT MyField AS Result
FROM tb_Client;

Or i tried this one, but same result:
PARAMETERS MyField Text ( 255 );
SELECT MyField
FROM tb_Client
GROUP BY MyField;

Apparently, the stored procedure doesnt accept any parameter in the
first part of the query(in the Select portion) ?

thanks
jean claude
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The PARAMETERS keyword is not supported by MS SQL Server. You'd do
something like this:

CREATE PROCEDURE mySP @MyField VARCHAR(255)
AS
SELECT column1
FROM tb_Client
WHERE myField = @MyField

Your query doesn't make any sense. Even if it was run in Access with
MyField = "This Field" it would return a recordset like this:

Expr1
- ----------
This Field
This Field
This Field
This Field
.... etc. ...
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQDuL64echKqOuFEgEQIPBgCg0BYeh609nUPPwjsIypIEhJ 2HY5MAn3pC
/SDczQmQ76BQykXbr5y6Ty/V
=Vpcp
-----END PGP SIGNATURE-----
Station Media wrote:
here my problem, i use stored procedure in ACCESS database(latest
version), and i would like to use this procedure but it doesnt work,
do you know why ?
Procedure:
PARAMETERS MyField Text ( 255 );
SELECT DISTINCT MyField AS Result
FROM tb_Client;

Or i tried this one, but same result:
PARAMETERS MyField Text ( 255 );
SELECT MyField
FROM tb_Client
GROUP BY MyField;


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.