DateAdd

A

Andreas

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
 
J

Jeff Boyce

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/
 
A

Andreas

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/


Andreas said:
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
 
P

Pieter Wijnen

Try posting your queries SQL, Then it's easier for us

Pieter


Andreas said:
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/


Andreas said:
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
 
A

Andreas

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


Andreas said:
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/


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!
 
P

Pieter Wijnen

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


Andreas said:
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


Andreas said:
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/


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!
 
A

Andreas

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


Andreas said:
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/


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!
 
P

Pieter Wijnen

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






Andreas said:
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


Andreas said:
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/


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!
 
P

Pieter Wijnen

Also you can try wrapping [Enter Date] In CDate, ie WHERE ... CDate([Enter
Date]) ....

Pieter

"Pieter Wijnen"
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






Andreas said:
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/


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!
 
A

Andreas

A never ending story...

Yes it is a lovely mix of different languages. I just have an italian
version and I would prefer Swedish.... Sitting in Milan right now.

I saw your E-mail; said something about Norway. Why I am asking is because I
got the last error message in Swedish. The first error called
"kompileringsfel" was solved by your last string, the sqldate.

But when I paste the larger string from last time into the sql window in the
question i get four questions regarding dates (2 times) and then ragione
sociale etc. Whatever I write I get a ne error message saying, in Swedish
(Tell me if you prefer English and I will translate it)

Detta uttryck är antigen felaktigt skrivet eller för komplicerat för att
kunna utvärderas. Ett numeriskt uttryck kan t ex innehålla för många
komplicerade element. uttrycket kan kanske förenklas genom att delar av det
tilldelas variabler

??????????????

(How much does it cost you to fly down to Milan over the day? ;)


"Pieter Wijnen" skrev:
Also you can try wrapping [Enter Date] In CDate, ie WHERE ... CDate([Enter
Date]) ....

Pieter

"Pieter Wijnen"
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






Andreas said:
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/


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!
 
A

Andreas

I have some rows that are empty in the former date field, may that disturb?

"Andreas" skrev:
A never ending story...

Yes it is a lovely mix of different languages. I just have an italian
version and I would prefer Swedish.... Sitting in Milan right now.

I saw your E-mail; said something about Norway. Why I am asking is because I
got the last error message in Swedish. The first error called
"kompileringsfel" was solved by your last string, the sqldate.

But when I paste the larger string from last time into the sql window in the
question i get four questions regarding dates (2 times) and then ragione
sociale etc. Whatever I write I get a ne error message saying, in Swedish
(Tell me if you prefer English and I will translate it)

Detta uttryck är antigen felaktigt skrivet eller för komplicerat för att
kunna utvärderas. Ett numeriskt uttryck kan t ex innehålla för många
komplicerade element. uttrycket kan kanske förenklas genom att delar av det
tilldelas variabler

??????????????

(How much does it cost you to fly down to Milan over the day? ;)


"Pieter Wijnen" skrev:
Also you can try wrapping [Enter Date] In CDate, ie WHERE ... CDate([Enter
Date]) ....

Pieter

"Pieter Wijnen"
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/


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!
 
P

Pieter Wijnen

Svensk går bra det ;-), Norsk, Dansk & Nederlands ook.

But I Prefer English in the News Groups (& for my Access Apps - Any
Localized Access version can Run English Access Apps - Not the other way
around ).

I would have Gone back to the Forms idea though.

Create a Form Called DateInput (Or Use an Existing one )
Add an unbound control called DateEntry, Set it's Format to Short Date Or
Medium Date (The latter is "better", as it's the same for all regional
settings)

Save the Form, Open it and enter a date into the DateEntry & move out of it
to ensure it's "saved" & is recognized as a date

Add a Parameters Clause to the SQL to ensure Access Knows it's a Date

PARAMETERS [Forms]![DateInput]![DateEntry] DateTime;
SELECT .....
FROM ....
WHERE [ny_Antonios första].Date >= DateAdd("d", -1,
[Forms]![DateInput]![DateEntry])
AND [ny_Antonios första].Date < DateAdd("d", 2,
[Forms]![DateInput]![DateEntry])
etc

This Should *Not* Require the Use of SQLDate or CDate

I'll Check How to go to Milan the fastest & cheapest way from Stavanger <g>

Pieter

If this still doesn't work & the data is not to sensitive you can send a
stripped version of the db (with only some relevant data & Queries)
to wijnen at online no - which will be a bit cheaper than the air fare <g>







Andreas said:
A never ending story...

Yes it is a lovely mix of different languages. I just have an italian
version and I would prefer Swedish.... Sitting in Milan right now.

I saw your E-mail; said something about Norway. Why I am asking is because
I
got the last error message in Swedish. The first error called
"kompileringsfel" was solved by your last string, the sqldate.

But when I paste the larger string from last time into the sql window in
the
question i get four questions regarding dates (2 times) and then ragione
sociale etc. Whatever I write I get a ne error message saying, in Swedish
(Tell me if you prefer English and I will translate it)

Detta uttryck är antigen felaktigt skrivet eller för komplicerat för att
kunna utvärderas. Ett numeriskt uttryck kan t ex innehålla för många
komplicerade element. uttrycket kan kanske förenklas genom att delar av
det
tilldelas variabler

??????????????

(How much does it cost you to fly down to Milan over the day? ;)


"Pieter Wijnen" skrev:
Also you can try wrapping [Enter Date] In CDate, ie WHERE ...
CDate([Enter
Date]) ....

Pieter

"Pieter Wijnen"
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/


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!
 
P

Pieter Wijnen

no, they're just not included

Pieter

Andreas said:
I have some rows that are empty in the former date field, may that disturb?

"Andreas" skrev:
A never ending story...

Yes it is a lovely mix of different languages. I just have an italian
version and I would prefer Swedish.... Sitting in Milan right now.

I saw your E-mail; said something about Norway. Why I am asking is
because I
got the last error message in Swedish. The first error called
"kompileringsfel" was solved by your last string, the sqldate.

But when I paste the larger string from last time into the sql window in
the
question i get four questions regarding dates (2 times) and then ragione
sociale etc. Whatever I write I get a ne error message saying, in Swedish
(Tell me if you prefer English and I will translate it)

Detta uttryck är antigen felaktigt skrivet eller för komplicerat för att
kunna utvärderas. Ett numeriskt uttryck kan t ex innehålla för många
komplicerade element. uttrycket kan kanske förenklas genom att delar av
det
tilldelas variabler

??????????????

(How much does it cost you to fly down to Milan over the day? ;)


"Pieter Wijnen" skrev:
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!
 
A

Andreas

True about using English as language, I would die for someone down here
talking proper English right now, my Italian is.... improving...

The last idea sounds really good, but I have to ask a silly question before
the weekend so I can try it. As I only have learned Access using the Italian
version I do not exactly understand what you mean by "unbound control"? I
have tried to look it up in the bible of Mr Viescas and by creating all the
controls I know of and searching for the Italian word for Date in the format
menu in the properties. Could you please just explain that step a little
further and then we'll close down for the weekend :)

(Are you sure about mailing instead of travelling, we have 36 degrees, sun
and Medelhavet nearby. ;) )

"Pieter Wijnen" skrev:
Svensk går bra det ;-), Norsk, Dansk & Nederlands ook.

But I Prefer English in the News Groups (& for my Access Apps - Any
Localized Access version can Run English Access Apps - Not the other way
around ).

I would have Gone back to the Forms idea though.

Create a Form Called DateInput (Or Use an Existing one )
Add an unbound control called DateEntry, Set it's Format to Short Date Or
Medium Date (The latter is "better", as it's the same for all regional
settings)

Save the Form, Open it and enter a date into the DateEntry & move out of it
to ensure it's "saved" & is recognized as a date

Add a Parameters Clause to the SQL to ensure Access Knows it's a Date

PARAMETERS [Forms]![DateInput]![DateEntry] DateTime;
SELECT .....
FROM ....
WHERE [ny_Antonios första].Date >= DateAdd("d", -1,
[Forms]![DateInput]![DateEntry])
AND [ny_Antonios första].Date < DateAdd("d", 2,
[Forms]![DateInput]![DateEntry])
etc

This Should *Not* Require the Use of SQLDate or CDate

I'll Check How to go to Milan the fastest & cheapest way from Stavanger <g>

Pieter

If this still doesn't work & the data is not to sensitive you can send a
stripped version of the db (with only some relevant data & Queries)
to wijnen at online no - which will be a bit cheaper than the air fare <g>







Andreas said:
A never ending story...

Yes it is a lovely mix of different languages. I just have an italian
version and I would prefer Swedish.... Sitting in Milan right now.

I saw your E-mail; said something about Norway. Why I am asking is because
I
got the last error message in Swedish. The first error called
"kompileringsfel" was solved by your last string, the sqldate.

But when I paste the larger string from last time into the sql window in
the
question i get four questions regarding dates (2 times) and then ragione
sociale etc. Whatever I write I get a ne error message saying, in Swedish
(Tell me if you prefer English and I will translate it)

Detta uttryck är antigen felaktigt skrivet eller för komplicerat för att
kunna utvärderas. Ett numeriskt uttryck kan t ex innehålla för många
komplicerade element. uttrycket kan kanske förenklas genom att delar av
det
tilldelas variabler

??????????????

(How much does it cost you to fly down to Milan over the day? ;)


"Pieter Wijnen" skrev:
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/


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
 
P

Pieter Wijnen

Just missed me, we have a great food festival in town this weekend.
No, I checked the fare price, about 400 euros t/r, I can do that <g>, no
planes before monday though (I can do it - seriously, just provide me with
the workspace & accomodations for the duration- I'll do the rest for free)
back to business
An unbound control is basically - or simply put - anything not bound to a
field in a table
And you *should* really change that Date Field to another name than Date
(confuses the hell out of MsAccess)

Ciao
Pieter

(Itialian *not* being one of my languages)

Andreas said:
True about using English as language, I would die for someone down here
talking proper English right now, my Italian is.... improving...

The last idea sounds really good, but I have to ask a silly question
before
the weekend so I can try it. As I only have learned Access using the
Italian
version I do not exactly understand what you mean by "unbound control"? I
have tried to look it up in the bible of Mr Viescas and by creating all
the
controls I know of and searching for the Italian word for Date in the
format
menu in the properties. Could you please just explain that step a little
further and then we'll close down for the weekend :)

(Are you sure about mailing instead of travelling, we have 36 degrees, sun
and Medelhavet nearby. ;) )

"Pieter Wijnen" skrev:
Svensk går bra det ;-), Norsk, Dansk & Nederlands ook.

But I Prefer English in the News Groups (& for my Access Apps - Any
Localized Access version can Run English Access Apps - Not the other way
around ).

I would have Gone back to the Forms idea though.

Create a Form Called DateInput (Or Use an Existing one )
Add an unbound control called DateEntry, Set it's Format to Short Date Or
Medium Date (The latter is "better", as it's the same for all regional
settings)

Save the Form, Open it and enter a date into the DateEntry & move out of
it
to ensure it's "saved" & is recognized as a date

Add a Parameters Clause to the SQL to ensure Access Knows it's a Date

PARAMETERS [Forms]![DateInput]![DateEntry] DateTime;
SELECT .....
FROM ....
WHERE [ny_Antonios första].Date >= DateAdd("d", -1,
[Forms]![DateInput]![DateEntry])
AND [ny_Antonios första].Date < DateAdd("d", 2,
[Forms]![DateInput]![DateEntry])
etc

This Should *Not* Require the Use of SQLDate or CDate

I'll Check How to go to Milan the fastest & cheapest way from Stavanger
<g>

Pieter

If this still doesn't work & the data is not to sensitive you can send a
stripped version of the db (with only some relevant data & Queries)
to wijnen at online no - which will be a bit cheaper than the air fare
<g>







Andreas said:
A never ending story...

Yes it is a lovely mix of different languages. I just have an italian
version and I would prefer Swedish.... Sitting in Milan right now.

I saw your E-mail; said something about Norway. Why I am asking is
because
I
got the last error message in Swedish. The first error called
"kompileringsfel" was solved by your last string, the sqldate.

But when I paste the larger string from last time into the sql window
in
the
question i get four questions regarding dates (2 times) and then
ragione
sociale etc. Whatever I write I get a ne error message saying, in
Swedish
(Tell me if you prefer English and I will translate it)

Detta uttryck är antigen felaktigt skrivet eller för komplicerat för
att
kunna utvärderas. Ett numeriskt uttryck kan t ex innehålla för många
komplicerade element. uttrycket kan kanske förenklas genom att delar av
det
tilldelas variabler

??????????????

(How much does it cost you to fly down to Milan over the day? ;)


"Pieter Wijnen" skrev:

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
 

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