473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Parameters in a SELECT DISTINCT doesnt work

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
1 2505
-----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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Kelvin | last post by:
Okay so this is baking my noodle. I want to select all the attritbutes/fields from a table but then to excluded any row in which a single attributes data has been duplicated. I.E. Here's my...
18
by: mathilda | last post by:
My boss has been adamant that SELECT DISTINCT is a faster query than SELECT all other factors being equal. I disagree. We are linking an Access front end to a SQL Server back end and normally are...
1
by: Fia | last post by:
Hi I have tried the code below to ask a question from an Access database, but I don't get any records wich I know I should. sökaOrdCom = New OleDbCommand("Select * from kött where köttid Like...
2
by: Brad Isaacs | last post by:
Good evening friends, I have added a Drop Down List box control to my web form. I am using the web.config connection string to access my SQL Server 2000 db. Inside that db I have a table named...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.