Home > SQL Development > SQL - Please help

SQL - Please help



Hi all,<br><br>I ran this sql statement and it worked<br><br>SELECT *<br>FROM MEMBERS<br>WHERE (UserID LIKE '2%')<br><br><br>but when I tried to do the same for a date field, it didn't<br><br>SELECT *<br>FROM MEMBERS<br>WHERE (DateEntered LIKE '4/2%')<br><br><br>I got no errors but no records were returned either. <br><br>The date format is: 4/2/2002 2:06:00 PM<br><br>Please help<br><br><br>Thanks all,<br>JT

    
Guest


you use # sign between date

Was this answer helpful ? Yes No   
Guest


The # is for Access. If this is SQL you need to do it like this :<br><br>SELECT *<br>FROM MEMBERS<br>WHERE Month(DateEntered) = 4 <br> AND Day(DateEntered) = 2<p><hr size="1" width="50%" align="left" />dotNetBB Forum Developer<br><b><i>Building A Better Community, One Post At A Time</i></b><br><a href="http://www.dotnetbb.com" target="_blank">www.dotnetbb.com</a></p>

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved