Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / August 2004

Tip: Looking for answers? Try searching our database.

Stored procedure/adp question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
EManning - 08 Jul 2004 20:29 GMT
I've got an A2K adp that allows the user to select one or all medical
residents for a report.  I'd like to allow the user to select more than one
resident as well.  Creating a stored procedure to select just one resident
or selecting all residents is simple.  If this were an mdb, I'd construct a
SQL statement that would take all chosen residents and pull just those from
a table.  Is there a way to do this in a sp?
Larry  Linson - 08 Jul 2004 23:50 GMT
Why don't you construct the proper SQL and use that as the RecordSource for
the Report instead of worrying about a stored procedure? Just bear in mind
that SQL Server's "flavor" of SQL is a bit different than Access' "flavor"
of SQL (e.g., the "*" wildcard used in Access is "%" in MS SQL Server).

 Larry Linson
 Microsoft Access MVP

> I've got an A2K adp that allows the user to select one or all medical
> residents for a report.  I'd like to allow the user to select more than one
> resident as well.  Creating a stored procedure to select just one resident
> or selecting all residents is simple.  If this were an mdb, I'd construct a
> SQL statement that would take all chosen residents and pull just those from
> a table.  Is there a way to do this in a sp?
EManning - 09 Jul 2004 14:07 GMT
Thanks for your reply, Larry.  That's what I thought I'd have to do.
However I wanted to make sure there wasn't something I was missing as far as
using a stored procedure for this.

> Why don't you construct the proper SQL and use that as the RecordSource for
> the Report instead of worrying about a stored procedure? Just bear in mind
[quoted text clipped - 13 lines]
> from
> > a table.  Is there a way to do this in a sp?
Robertq - 29 Aug 2004 16:26 GMT
Larry
try changing the where clause to have an or for the
selection values, be sure to put the paren's around the or
statement or it will always return all records

@wantres varchar(30) default ""
select * from myfile
where mycode = (@wantcode or @wantcode = "")

instead of
where mycode = @wantcode

>-----Original Message-----
>Why don't you construct the proper SQL and use that as the RecordSource for
[quoted text clipped - 16 lines]
>
>.
Lyle Fairfield - 09 Jul 2004 14:31 GMT
"EManning" <emanning_spambegone@kumc.edu> wrote in news:OlsixHSZEHA.3112
@tk2msftngp13.phx.gbl:

> I've got an A2K adp that allows the user to select one or all medical
> residents for a report.  I'd like to allow the user to select more than one
> resident as well.  Creating a stored procedure to select just one resident
> or selecting all residents is simple.  If this were an mdb, I'd construct a
> SQL statement that would take all chosen residents and pull just those from
> a table.  Is there a way to do this in a sp?

IN

Signature

Lyle
--
use iso date format: yyyy-mm-dd
http://www.w3.org/QA/Tips/iso-date
--
The e-mail address isn't, but you could use it to find one.

EManning - 09 Jul 2004 14:37 GMT
Well, I thought about that but how would I create the list of residents
chosen for the IN statement?

> "EManning" <emanning_spambegone@kumc.edu> wrote in news:OlsixHSZEHA.3112
> @tk2msftngp13.phx.gbl:
[quoted text clipped - 7 lines]
>
> IN
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.