473,479 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help with WHERE Clause in Stored Procedure

Hi,

I have an sp with the following WHERE clause

@myqarep varchar(50)

SELECT tblCase.qarep FROM dbo.tblCase

WHERE dbo.tblCase.qarep = CASE @myqarep WHEN '<All>' THEN
dbo.tblCase.qarep ELSE @myqarep

@myqarep is returned from a combo box (ms access)...the user either
picks a qarep from the combo box or they leave the default which is
'<All>'

they problem i'm having is that if the record's value for
dbo.tblCase.qarep is null...the record does not show up in the
results...but i need it to

any help is appreciated.

thanks
Paul

Jul 23 '05 #1
2 1459
... WHERE qarep = @myqarep
OR @myqarep = '<All>'

--
David Portas
SQL Server MVP
--

Jul 23 '05 #2
thanks for the quick response...i'll give it a try!

David Portas wrote:
... WHERE qarep = @myqarep
OR @myqarep = '<All>'

--
David Portas
SQL Server MVP
--


Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4691
by: berthelot samuel | last post by:
Hi everyone, I am currently trying to write a report based on a View of SQL Server. Basically, I have 3 tables : Hardware, SoftwareInstalled and Software with SoftwareInstalled that keeps track of...
3
1405
by: JIMMIE WHITAKER | last post by:
The below stored procedure works. However, I am trying to use a text box from a temp form for the where clause. WHERE Transactions.TransactionID = !! I even tried changing first line: Alter...
2
2313
by: jaYPee | last post by:
I have an existing query from MS Access that I want to convert it to SQL Server Stored Proc. My problem is on how to convert the WHERE clause. This is the query from MS Access: SELECT...
5
1259
by: ndn_24_7 | last post by:
Hello all, I'm trying to write a stored procedure that will prompt the user for a date range and produce a report based on that date range and 4 incident types. I only need count how may times...
2
2157
by: pnichols | last post by:
We have a large select statement being executed statically from an SQL stored procedure, such as: SELECT ...about 100 columns... FROM ...about 30 tables... WHERE ...about 10 predicates... AND...
18
5930
by: Bill Smith | last post by:
The initial row is inserted with the colPartNum column containing a valid LIKE pattern, such as (without the single quotes) 'AB%DE'. I want to update the column value with the results of a query...
1
3179
by: karups | last post by:
Hi, I've got listbox in my .aspx page where the users can make multiple selection. So, Users can select 7 items in listbox, I have to take value from items and pass it to stored procedure to...
1
7472
by: peaceburn | last post by:
Hi, I'm gonna pull my hair in the coming days with these DB2 stored procedures. So the issue, let's assume a simple stored procedure like this : CREATE PROCEDURE MYSCHEMA.PROCEDURE1 ( )...
4
1478
by: Simon Gare | last post by:
Hi need a stored procedure to replace the 4 commands listed below UPDATE dbo.booking_form SET total_cost = mileage_charge + waiting_charge + CarParkToDriver UPDATE dbo.booking_form SET VAT =...
20
6273
by: billmaclean1 | last post by:
I need to write a stored procedure that selects from a table and returns the result set. I don't always know the TableSchema that I need to use when qualifying the table at run-time Example:...
0
6903
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
7027
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,...
1
6726
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
6861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4468
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2987
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1291
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
557
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
170
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.