Also you can try wrapping [Enter Date] In CDate, ie WHERE ...
CDate([Enter
Date]) ....
Pieter
"Pieter Wijnen"
<it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.please@online.replace.with.norway>
wrote in message I Think It's got to do with Date Format Or with The Fact that your
field is
Called Date
You Should start by Changing the Fields Name to DateEntered or
something
similar as "Date" is a reserved word in MsAccess.
Also I'd advise you to avoid spaces in Object Names unless you're
very
fond of hitting [].
Stick to A-Z, a-z, 0-9 and _
You can always use the caption Property to Present it.
ie Change 'ny_Antonios första' to ny_Antonios_First, NEW RAGIONE to
NEW_RAGIONE - interesting mix of Swedish & Italian though <g>
You can also test by putting a literal date into the SQL.
Note that dates have to be in American (mm/dd/yyyy) or ISO
(yyyy-mm-dd)
format in the SQL (both used in the sample below), and surrounded by
#
SELECT [ny_Antonios första].Date AS Espr1, [ny_Antonios första].[NEW
RAGIONE
SOCIALE], [ny_Antonios första].[NEW INDIRIZZO], [ny_Antonios
första].[NEW
LOCALITÁ], Count([ny_Antonios första].SommaDiColli) AS
ConteggioDiSommaDiColli
FROM [ny_Antonios första]
WHERE [ny_Antonios första].Date >= DateAdd("d", -1, #9/11/2001#) AND
[ny_Antonios första].Date < DateAdd("d", 2, #2001-9-11#)
GROUP BY [ny_Antonios första].Date, [ny_Antonios första].[NEW RAGIONE
SOCIALE], [ny_Antonios första].[NEW INDIRIZZO], [ny_Antonios
första].[NEW
LOCALITÁ];
I usually include/Create a SQLDate Function to make sure
ie in a (new) module:
Public Function SQLDate(ByVal D As Date) As String
SQLDate = "#" & Format(D,"mm\/dd\/yyyy") & "#" ' The "\/" ensures
"/" to
be used in the returned string , otherwise "/" will be replaced by
regional settings
End Function
HTH
Pieter
Me scuse ma io non capisco!
I do really appreciate your help, however I must ask an amateur
question;
now I tried to copy/paste the first string into the sql in the
question I
had, erasing everything so basically I started a new question. Then
I got
4
question (date, date, ragione etc) but no matter how I answered them
I am
not
able to see any information, an empty question without information
pops
up
instead.
I did the same with the second string but as a source to a form by
pasting
it into a question that I went into the properties and data in a new
form
to
get to. Same result. How should I do to make it work?
"Pieter Wijnen" skrev:
capice
PARAMETERS [Enter Date] DateTime;
SELECT [ny_Antonios första].Date AS Espr1, [ny_Antonios
första].[NEW
RAGIONE
SOCIALE], [ny_Antonios första].[NEW INDIRIZZO], [ny_Antonios
första].[NEW
LOCALITÁ], Count([ny_Antonios första].SommaDiColli) AS
ConteggioDiSommaDiColli
FROM [ny_Antonios första]
WHERE [ny_Antonios första].Date >= DateAdd("d", -1, [Enter Date])
AND
[ny_Antonios första].Date < DateAdd("d", 2, [Enter Date])
GROUP BY [ny_Antonios första].Date, [ny_Antonios första].[NEW
RAGIONE
SOCIALE], [ny_Antonios första].[NEW INDIRIZZO], [ny_Antonios
första].[NEW
LOCALITÁ];
I would probably use a Form To Enter The Date Though & Use:
PARAMETERS Forms!MyForm![Enter Date] DateTime;
SELECT [ny_Antonios första].Date AS Espr1, [ny_Antonios
första].[NEW
RAGIONE
SOCIALE], [ny_Antonios första].[NEW INDIRIZZO], [ny_Antonios
första].[NEW
LOCALITÁ], Count([ny_Antonios första].SommaDiColli) AS
ConteggioDiSommaDiColli
FROM [ny_Antonios första]
WHERE [ny_Antonios första].Date >= DateAdd("d", -1,
Forms!MyForm![Enter
Date])
AND [ny_Antonios första].Date < DateAdd("d", 2, Forms!MyForm![Enter
Date])
GROUP BY [ny_Antonios första].Date, [ny_Antonios första].[NEW
RAGIONE
SOCIALE], [ny_Antonios första].[NEW INDIRIZZO], [ny_Antonios
första].[NEW
LOCALITÁ];
Pieter
Here is the sql before the criteria, not possible to open sql
with the
criteria
Thanks!
Andreas
SELECT [ny_Antonios första].Date AS Espr1, [ny_Antonios
första].[NEW
RAGIONE
SOCIALE], [ny_Antonios första].[NEW INDIRIZZO], [ny_Antonios
första].[NEW
LOCALITÁ], Count([ny_Antonios första].SommaDiColli) AS
ConteggioDiSommaDiColli
FROM [ny_Antonios första]
GROUP BY [ny_Antonios första].Date, [ny_Antonios första].[NEW
RAGIONE
SOCIALE], [ny_Antonios första].[NEW INDIRIZZO], [ny_Antonios
första].[NEW
LOCALITÁ];
"Pieter Wijnen" skrev:
Try posting your queries SQL, Then it's easier for us
Pieter
Indeed, I am working in a query made on a query that is made
on a
table.
The
first query shows which dates two different companies delivers
to
the
same
adress. Now I want to make the same thing except not looking
at
just
one
date, instead a time interval as described
Andreas
"Jeff Boyce" skrev:
Andreas
I can't tell from your description where you are trying to
use the
criteria.
Are you working on a query?
By the way, if your field is actually named "Date", be aware
that
Access
treats this as a reserved word, and may get confused as to
what
field/which
function to use.
--
Regards
Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Microsoft Registered Partner
https://partner.microsoft.com/
message
I want to put this string as a criteria in my Date field to
be
able
to
see
the results from different date intervals.
= DateAdd("d"; -1; [Enter Date]) AND < DateAdd("d"; 2;
[Enter
Date])
But I receive an error saying:
Syntax Error in expression
E possible che sia stato immeso un operande senza un
operatore
(italian)
What have I done wrong?
And: Is it possible to visualize this time interval (+-1
day)
for
all
dates
without being forced to put in a special date; i.e. to show
this
interval
for
all dates at the same time?
Would REALLY need to solve this issue?
Thanks
Andreas
--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4382 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4382 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4388 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4388 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!