Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want records of particular date only. Not to give time in condition criteria.
Please guide...

Dim fndRows() As DataRow

fndRows = DataSet1.TransactionTestMaster.Select("trandate='15/02/2014'")

TextBox4.Text = fndRows.Length


3 Records are in TransactionTestMaster table
TranDate ( Column Name)
1) 2014-02-15 16:51:00
2) 2014-02-15 17:45:00
3) 2014-04-16 17:48:00

Please guide....
Posted

I got the solution...

VB
Dim fndRows() As DataRow
Dim dt1, dt2 As Date

dt1 = DateTran.Value.AddDays(-1)
dt2 = DateTran.Value.AddDays(1)

fndRows = DataSet1.TransactionTestMaster.Select("trandate >' " & dt1 & "' and trandate <'" & dt2 & "'")
TxtDaySrNo.Text = fndRows.Length + 1



This is working.
 
Share this answer
 
It is not working. Please do needful or tell another way...
 
Share this answer
 
Don't guarantee it - because I have no idea how your TransactionTestMaster.Select method works - but try this:
VB
fndRows = DataSet1.TransactionTestMaster.Select("DATEDIFF(d, '2014-02-15', trandate)=0")
 
Share this answer
 

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