Solved

Query

Posted on 2000-02-18
4
188 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
ID: 2534188
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
ID: 2534257
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
ID: 2535522
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
ID: 2535829
Try single quotes instead of double.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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