Problens with query?

G

Guest

Hi again!
Now I am having some problens with a query involving date, look at the
following:
SELECT FAT_ID, FAT_EMISSAO, FAT_VENCIMENTO FROM FATURA WHERE (FAT_ID=16) AND
(FAT_ATIVA=TRUE) AND (FAT_EMISSAO BETWEEN #4/1/2006# AND #6/1/2006#);
The query returns no rows, and according to the table there is a record that
attends to the condition.
Here's the tabl
FAT_ID FAT_EMISSAO FAT_VENCIMENTO FAT_DESCONTO FAT_DESCONTO_ATE FAT_ATIVA FAT_INICIO FAT_FIM CLI_ID USU_INCLUSAO USU_NOME_INCLUSAO USU_ALTERACAO USU_NOME_ALTERACAO USU_EXCLUSAO USU_NOME_EXCLUSAO USU_REATIVACAO USU_NOME_REATIVACAO
16 5/1/2006 10/1/2006 R$ 0,00 Sim 21/12/2005 10:59:46 5/1/2006
10:59:50 3 5/1/2006 09:03:07 ADMINISTRADOR 5/1/2006
09:36:18 ADMINISTRADOR 5/1/2006 09:37:06 ADMINISTRADOR
17 5/1/2006 10/1/2006 Sim 21/12/2005 10:59:46 5/1/2006
10:59:50 1 5/1/2006 09:04:52 ADMINISTRADOR 5/1/2006
09:36:20 ADMINISTRADOR 5/1/2006 09:37:07 ADMINISTRADOR
....
Could you please help me with it?
Thanks in advance
 
A

Allen Browne

From your example, I take it that you live in a country that used
day/month/year as the date format. Access is made in America, and expects
dates in the month/day/year format. Your query is therefore looking for
records between April 1 and June 1, and so not finding any.

For a more complete explanation of how to ensure Access understands your
dates correctly, see:
International Date Formats in Access
at:
http://allenbrowne.com/ser-36.html
 
G

Guest

Thank you

Your tip solved mey problem, I am programing with delphi, so I used a
function called Formatdatetime('mm/dd/yyyy',date) to format properly my date
and send to Access which understook correctly my query, Thanks Again!

"Allen Browne" escreveu:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top