-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: thajeer
Message 2 in Discussion
Hey Kumar,
What
you can do is a small fudge .. I know it works
in your select query add the following
piece in bold
Select * from tbl1 where Cid like @Cid and ( pid like
@Pid or ( @Pid = '%' and pid is null ) ) and Fdate >[EMAIL PROTECTED]
and TDate = @Tdate
hope this help . do lemme know if u
run into issues
Cheers!!!
Thajeer Thundiyil
"kumarm" <[EMAIL PROTECTED]>
06/15/2004 05:08 PM
Please respond to
"BDOTNET" <[EMAIL PROTECTED]>
To
[EMAIL PROTECTED]
cc
Subject
Help in sql - stored procedure
New Message on BDOTNET
Help
in sql - stored procedure
Reply
Reply
to Sender Recommend
Message 1 in Discussion
From:
kumarm
Hai everyone
This is my Stroreprocedure --- Example
Create sp_test
(
@FDate datetime
@TDate Datetime,
@ Cid varchar(10),
@ PId Varchar(10),
)
as
begin
set nocount on
if @Cid = ''
begin
@Cid = '%'
end
if @Pid = ''
begin
@Pid = '%'
end
Select * from tbl1 where Cid like @Cid and pid likd @Pid and Fdate >[EMAIL PROTECTED]
and TDate = @Tdate
union
Select * from tbl2 where Cid like @Cid and pid likd @Pid and Fdate >[EMAIL PROTECTED]
and TDate = @Tdate
set nocount off
end
The problem is :
I have 200 records in my table
When i execute my sp like : sp_test '01 may 2004,'30 jun 2004','',''
I am getting only 180 records, but there is 200 records.
After checking the table i found in the tbl1 for the colum CID there is
Null value.
Why when i give '%' i not taking all the value for --- cid like '%'
how to get all the values from the table using and modifying the
storeprocedure.
Please need help very urgent
with regards
kumar.m
_________________________________________________________________
Looking for something? Cant find it anywhere?
http://go.msnserver.com/IN/50756.asp Log onto baazee.com
View
other groups in this category.
Also on MSN:
Start
Chatting |
Listen
to Music |
House
& Home |
Try
Online Dating |
Daily
Horoscopes
To stop getting this e-mail, or change how often it arrives, go to your
E-mail
Settings.
Need help? If you've forgotten your password, please go to Passport
Member Services.
For other questions or feedback, go to our Contact
Us page.
If you do not want to receive future e-mail from this MSN group, or if
you received this message by mistake, please click the "Remove"
link below. On the pre-addressed e-mail message that opens, simply click
"Send". Your e-mail address will be deleted from this group's
mailing list.
Remove
my e-mail address from BDOTNET.
ForwardSourceID:NT00007436
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]