Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi how to search records by date?how to create sp for this..
in my table tblCurrencySale
SQL
csID int(pk)
csPurchaseAmount varchar(50)
csSoldAmount varchar(50)
csProfitAmount varchar(50)
csDate varchar(50)


this my table columns so by date i want to search records.and it should display records of that day only..so can u suggest me?
thanks in advance..
Posted
Updated 11-May-12 19:55pm
v2

1 solution

Hi Friend,

Check this below code...

just include the following sql statements in ur Procedure...
this will work fine...


SQL
select * from tblCurrencySale  where Convert(varchar(10),csDate,101)  between '05/01/2012' and '05/12/2012'
 
Share this answer
 
v2
Comments
ythisbug 12-May-12 1:51am    
thank you Vijay. i will try and get back to you..thanks again.
P.Salini 12-May-12 1:56am    
Why between 2 times?
Rockstar_ 12-May-12 2:04am    
it's an option,if he wants all the transactions between the dates...

if he dont't , then remove BETWEEN and one DATE...
P.Salini 12-May-12 2:07am    
It's ok, but you have written 'between' 2 times in the query check once.
Rockstar_ 12-May-12 2:11am    
oh.. sorry....
now it is updated...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900