473,394 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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
4 1562
willakawill
1,646 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
113 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

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

Similar topics

2
by: John | last post by:
Hi everyone ! This is a first time I post a message here. If I post my message in a wrong group. Please ignore it. I am trying to build a website which allows users (can be thousands of...
4
by: donald | last post by:
Hi all, I have a website running asp (about to move to asp.net soon though) which has a list of DVD's I have the various pages I want, last 10, listing, full listing ect, but the one page i can't...
4
by: Michi | last post by:
I was wondering what the best solution is for making large numbers of TEXT (or BLOB?) fields searchable. For example, if I have a forum, what is the best way to be able to search for specific...
0
by: Chris Chandler | last post by:
Hello I am developing a web application that uses full text searching quite extensively. This is ideal where I am searching a large number of large varchar fields for a set of key words. My...
10
by: sffan | last post by:
I am new to database programming and was curious how others solve the problem of storing encrypted in data in db table columns and then subsequently searching for these records. The particular...
8
by: Stuart Clark | last post by:
Hello, I haven't done much with ASP but now I'm giving it a go! However, I'd like to ask if anybody knows if what I need to do is possible. I have a database with a lot of tables. Each table...
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
4
by: Jordan S. | last post by:
Using .NET 2.0 (C#) I'm writing a small app that will have a "Person" class that exposes FirstName and LastName properties. At runtime, a "People" collection will be populated with a few thousand...
5
by: justobservant | last post by:
When more than one keyword is typed into a search-query, most of the search-results displayed indicate specified keywords scattered throughout an entire website of content i.e., this is shown as...
9
by: ischwartz88 | last post by:
Hi, I am not a computer programmer. I have been learning VBA along the way of making this script. I know Access and SQL. I have a very large database with many tables and queries. My goal is to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.