Solved

Query

Posted on 2000-02-18
4
187 Views
Last Modified: 2010-04-04
Hi
i'm facing a problem with writing the correct sql statement, i have mastertable which containes invoices, i put radiobuttons each one equal to a month (january, february, ect..) and i put  spinedit i gave it's value 2000. Now how to write a correct sql statement if i choose february and the the spinedit.value is 2000 to filter the invoices under february month and year 2000.
thank you in advance
0
Comment
Question by:sivatagiherceg
4 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 10 total points
Comment Utility
Hi,

Since you use radiobuttons for months, you can use the ItemIndex property as month.

Thus RadioGroup1.ItemIndex + 1 returns the month.

eg January = 1
     ..

Now you've the month and date in number value and you can create a date to use in your query.

Regards, Zif.


0
 

Author Comment

by:sivatagiherceg
Comment Utility
ZiNab
please tel me whats wrong with this
Query1.Sql.Add ('select * from Invoice');
Query1.Sql.Add ('Where Date >= "1/1/2000" and Date <= "31/1/2000"');
When i run the program tels me type mismatch expression
0
 
LVL 17

Expert Comment

by:geobul
Comment Utility
Hi,

I think that there is a mismatch between days and months order. Look at your regional settings first. But I suppose that you have to start BDE Administrator an look at the 'Configuration-System-Formats-Date'.
There is a field 'MODE' with value = 1  for DMY, which is important in this case.

One more thing: DATE is a reserved word in BDE SQL and perhaps you should have to rename the field named 'Date'.

Regards, Geo
0
 
LVL 3

Expert Comment

by:d4jaj1
Comment Utility
Try single quotes instead of double.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now