Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Query

Posted on 2000-02-18
4
189 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

809 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