Solved

Query

Posted on 2000-02-18
4
192 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
[X]
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
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

624 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