?
Solved

Query

Posted on 2000-02-18
4
Medium Priority
?
193 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 40 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

719 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