Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
asifbhura
Posting Yak Master
165 Posts |
Posted - 2010-10-04 : 12:05:14
|
| Hi,I have two tables1.Applicationcolumn in application are like,applicationNo,userno,Offerno,Email,Mobile,department2.OfferColumns in offer are offerno,startdate,enddate,offertype,offerdescNow,I want all applicationWHERE offer'startdate is greater than current date and Application's userno='1'Regards,ASIF |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-10-04 : 12:22:02
|
| can we see what you tried till now?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
asifbhura
Posting Yak Master
165 Posts |
Posted - 2010-10-04 : 12:47:15
|
| ALTER PROCEDURE ERS_SP_GetAvailableApplicationByapplicant -- Add the parameters for the stored procedure here@ApplicantID nvarchar(50),@CurrentDate nvarchar(15)ASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT * FROMApplication aINNER JOIN Offer oON a.OfferNo=o.OfferNoWHERE a.ApplicantNo='1'AND o.SubmissionStartDate >=@CurrentDate |
 |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-10-04 : 14:14:03
|
quote: Originally posted by asifbhura ALTER PROCEDURE ERS_SP_GetAvailableApplicationByapplicant -- Add the parameters for the stored procedure here@ApplicantID nvarchar(50),@CurrentDate nvarchar(15) --Why don't you take it datetime or date datatypeASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT * FROMApplication aINNER JOIN Offer oON a.OfferNo=o.OfferNoWHERE a.ApplicantNo='1'AND o.SubmissionStartDate >=@CurrentDate --If the values are stored as varchar then conversion may be required.Let us know the datatype of SubmissionStartDate
|
 |
|
|
asifbhura
Posting Yak Master
165 Posts |
Posted - 2010-10-04 : 14:28:26
|
| SubmissionStartDate is also nvarchari have taken because we save date in arabicas number like '14311212'and parameter value will be also in same formatregards |
 |
|
|
|
|
|
|
|