|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Trouble getting records between 2 dates entered !!!
<i><b>Originally posted by : rocky</b></i><br />Helo ppl,<br /><br />I m having some trouble with just normaly query!!n drives me crazy!!<br /><br /><br />I AM USING SQL SERVER!!(ITS NOT ACCESS)<br /><br />i got 2 tables "purchase" & "product"<br /><br />fields in :<br /><br />purchase:<br />purchid,fk_prodid,purchdate,amount,receipt<br /><br />product: prodid, prodname,price<br /><br />fk_prodid is a foreign key to product table..<br /><br />and i m trying to fetch the records e.g<br /><br />prodname,puchdate,amount,receipt between 2 particular date selected by user!!<br /><br />i m able to to join the table but when i try to use between for those 2 dates selected!<br />it gives me all the records!!<br /><br />i tried datediff function!!<br /><br />the easiest was between but didnt work!!<br /><br />any help out there?<br /><br />thanx a lot!!<br /><br />rocky~~
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Ramesh (ramesh_bhanu@yahoo.com)</b></i><br /><br />Hi,<br /> DO a conversion of the Date Field and the Parameter Passed to a Same Format using CONVERT Function and do the comparison.....Now you may be using different formats for comparison<br /><br />Regards<br /><br /><br />------------<br />rocky at 3/13/2002 6:27:16 AM<br /><br />Helo ppl,<br /><br />I m having some trouble with just normaly query!!n drives me crazy!!<br /><br /><br />I AM USING SQL SERVER!!(ITS NOT ACCESS)<br /><br />i got 2 tables "purchase" & "product"<br /><br />fields in :<br /><br />purchase:<br />purchid,fk_prodid,purchdate,amount,receipt<br /><br />product: prodid, prodname,price<br /><br />fk_prodid is a foreign key to product table..<br /><br />and i m trying to fetch the records e.g<br /><br />prodname,puchdate,amount,receipt between 2 particular date selected by user!!<br /><br />i m able to to join the table but when i try to use between for those 2 dates selected!<br />it gives me all the records!!<br /><br />i tried datediff function!!<br /><br />the easiest was between but didnt work!!<br /><br />any help out there?<br /><br />thanx a lot!!<br /><br />rocky~~
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Trouble getting records between 2 dates entered !!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|