×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Searching using Date and String Values

Searching using Date and String Values

Searching using Date and String Values

(OP)
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!   

RE: Searching using Date and String Values

Thanks for the kind words, Wendz; unfortunately, you didn't specify what problem you are having or ask a question.

If the question is "how do I search by date", it would be easier to present a single textbox for them to type in a date, rather than separate month-day-year sections.  You can validate the date they type in by putting this in the textbox.Valid method:

    return dow(this.value) > 0

If I misguessed the issue, please clarify what problem you are having.

Robert Bradley

FoxDev - Visual FoxPro Development

RE: Searching using Date and String Values

(OP)
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.

RE: Searching using Date and String Values

Wendz

.....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.

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.

Hope this helps....

Tom Gahagan
edrest@alltel.net

REST

Your my reason for reason.... Carlos Santana

RE: Searching using Date and String Values

Do I need to have the coversion like dtoc or ctod?

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:

year
select ... where year(MyDateField) = m.year
* assuming m.year is numeric-type; if it is character-type, use val(m.year).  The search criteria (m.year) doesn't have to be a memvar; it could be a textbox value or form property, too.

month
select ... where month(MyDateField) = m.month
or
select ... where upper(cmonth(MyDateField)) = upper(m.month)

depending on whether the user will type in the month number or name of the month.

I hope this answered your question.

Robert Bradley

FoxDev - Visual FoxPro Development

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close