467,151 Members | 900 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,151 developers. It's quick & easy.

Searching the database

I am developing a program using Visual Basic 6, it handles car inventory and the issue and expiring date of the vehicles. The aim is to be able to search for the vehicle licences that are expiring at a certain period to renew them. Now am at the peak of it where I have to perform thsi but I have no clue.I need it to search the database for a range of dates. How do I go about this?
Note: The database contains different fields with different expiring date, so am not just searching one field. Can I use MSflexiGrid to display the result?
Thank you
Nov 6 '06 #1
  • viewed: 1251
Share:
4 Replies
1GB
I am developing a program using Visual Basic 6, it handles car inventory and the issue and expiring date of the vehicles. The aim is to be able to search for the vehicle licences that are expiring at a certain period to renew them. Now am at the peak of it where I have to perform thsi but I have no clue.I need it to search the database for a range of dates. How do I go about this?
Note: The database contains different fields with different expiring date, so am not just searching one field. Can I use MSflexiGrid to display the result?
Thank you
Hi. A little more information about the structure of the database (is it MS Access? What are the fields?) and a code snippet of where you are up to will help a lot in getting you where you want to be.
Thanks
Nov 6 '06 #2
Hi. A little more information about the structure of the database (is it MS Access? What are the fields?) and a code snippet of where you are up to will help a lot in getting you where you want to be.
Thanks
The database is MS Access and the fields that am trying to search for are date data types.
I dont know if given you the code would help because I havent written anything on the search but have written on the other areas. You could give me your email address so i could send the whole program to you and indicate the area am having difficulty in.
Nov 6 '06 #3
LacrosseB0ss
100+
how is your SQL knowledge? The best solution is 2 steps:

(1) Figure out the minimum date you want to search for. Then find the max date you want to find. The min will be sometime close to when the plate will expire (or today which is Now()) and max will be expiration date. These values will go in your SQL "Where" statement.

(2) Create and open a record set using your SQL statement to find only the relevant licenses. Use this to show all the data that appears.

Example of SQL:
Select licencePlate
from car (table)
where expiration > mindate
and expiration < maxdate

**of course you will sub in your own field names.
Nov 6 '06 #4
how is your SQL knowledge? The best solution is 2 steps:

(1) Figure out the minimum date you want to search for. Then find the max date you want to find. The min will be sometime close to when the plate will expire (or today which is Now()) and max will be expiration date. These values will go in your SQL "Where" statement.

(2) Create and open a record set using your SQL statement to find only the relevant licenses. Use this to show all the data that appears.

Example of SQL:
Select licencePlate
from car (table)
where expiration > mindate
and expiration < maxdate

**of course you will sub in your own field names.

Thanks, I do understand Sql to a limit and would have been able to do what you
said if it was just one field that am running the search on. I have like 13 columns i need to run the search on for each car as it has various licences like Vehicle Licence, Heavy Duty Permit and all that. So what do I do?Am going to try using a join after I create separate recordset for each column, would that work?
Nov 7 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by John | last post: by
4 posts views Thread by donald | last post: by
4 posts views Thread by Michi | last post: by
reply views Thread by Chris Chandler | last post: by
10 posts views Thread by sffan@hotmail.com | last post: by
33 posts views Thread by Geoff Jones | last post: by
4 posts views Thread by Jordan S. | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.