Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching using Date and String Values

Status
Not open for further replies.

Wendz

Programmer
Aug 9, 2000
47
PH
HI! Even I am still new to this site but I have learned a lot. People here are so generous with regards to their knowledge plus with matching examples. I have another problem with regards to searching by date and by names. I have just finished working on searching by their ID no. With DATE searching (i.e diplaying persons who will be having a birthday/schedule on this day) the user will have the option to select the year, month and the day. With NAME searching the user will type the character and the program will search the character typed on the database. As the user types the name their is a already a filtering done on list of person listed. I don't know if this is possible or if you have a better suggestion.. Thanks a lot! and More Power!   
 
Thanks for the kind words, Wendz; unfortunately, you didn't specify what problem you are having or ask a question.<br><br>If the question is &quot;how do I search by date&quot;, it would be easier to present a single textbox for them to type in a date, rather than separate month-day-year sections.&nbsp;&nbsp;You can validate the date they type in by putting this in the textbox.Valid method:<br><br><FONT FACE=monospace>&nbsp;&nbsp;&nbsp;&nbsp;return dow(this.value) &gt; 0</font><br><br>If I misguessed the issue, please clarify what problem you are having. <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
Thanks Robert. My problem is: Their is a bar on pad search by date and after that a prompt or another bar which will display By month, by Year or by Date. If year the user will be typing the year or a list on the combo. Same with Year. For Date the user will be typing the date. I have no more problem with the bars on the menu but with the coding on how to implement it. Do I need to have the coversion like dtoc or ctod? Your recent reply is very applicable.
 
Wendz<br><br>.....With NAME searching the user will type the character and the program will search the character typed on the database. As the user types the name their is a already a filtering done on list of person listed.<br><br>If there are not a lot of records the listbox control has an incremental search property that is a breeze to use. If there are lots of records however the listbox can be slow.<br><br>Hope this helps.... <p>Tom Gahagan<br><a href=mailto:edrest@alltel.net>edrest@alltel.net</a><br><a href= > </a><br>REST<br>
<br>
Your my reason for reason.... Carlos Santana
 
<font color=blue>Do I need to have the coversion like dtoc or ctod?</font><br><br>If you mean how to search if a user enters just a month or year value as a search criteria, it would be like this:<br><br><b>year</b><br><FONT FACE=monospace>select ... where year(MyDateField) = m.year</font><br>* assuming m.year is numeric-type; if it is character-type, use <FONT FACE=monospace>val(m.year)</font>.&nbsp;&nbsp;The search criteria (m.year) doesn't have to be a memvar; it could be a textbox value or form property, too.<br><br><b>month</b><br><FONT FACE=monospace>select ... where month(MyDateField) = m.month<br>or<br>select ... where upper(cmonth(MyDateField)) = upper(m.month)</font><br>depending on whether the user will type in the month number or name of the month.<br><br>I hope this answered your question. <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top