Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

DateAdd

Discussion in 'Information Technology' started by Andreas, Jul 28, 2006.

Tags:
  1. Andreas

    Andreas
    Expand Collapse
    Guest

    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
     
  2. Jeff Boyce

    Jeff Boyce
    Expand Collapse
    Guest

    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
    http://mvp.support.microsoft.com/

    Microsoft IT Academy Program Mentor
    http://microsoftitacademy.com/

    Microsoft Registered Partner
    https://partner.microsoft.com/


    "Andreas" <Andreas@discussions.microsoft.com> wrote in message
    news:8DC5BED7-6EEA-4DF7-8E43-56B1A17426FC@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
     
  3. Andreas

    Andreas
    Expand Collapse
    Guest

    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
    > http://mvp.support.microsoft.com/
    >
    > Microsoft IT Academy Program Mentor
    > http://microsoftitacademy.com/
    >
    > Microsoft Registered Partner
    > https://partner.microsoft.com/
    >
    >
    > "Andreas" <Andreas@discussions.microsoft.com> wrote in message
    > news:8DC5BED7-6EEA-4DF7-8E43-56B1A17426FC@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

    >
    >
     
  4. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

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

    Pieter


    "Andreas" <Andreas@discussions.microsoft.com> wrote in message
    news:5F71BE82-8485-4314-94B6-4A56CB5E46A9@microsoft.com...
    > 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
    >> http://mvp.support.microsoft.com/
    >>
    >> Microsoft IT Academy Program Mentor
    >> http://microsoftitacademy.com/
    >>
    >> Microsoft Registered Partner
    >> https://partner.microsoft.com/
    >>
    >>
    >> "Andreas" <Andreas@discussions.microsoft.com> wrote in message
    >> news:8DC5BED7-6EEA-4DF7-8E43-56B1A17426FC@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!
     
  5. Andreas

    Andreas
    Expand Collapse
    Guest

    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" <Andreas@discussions.microsoft.com> wrote in message
    > news:5F71BE82-8485-4314-94B6-4A56CB5E46A9@microsoft.com...
    > > 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
    > >> http://mvp.support.microsoft.com/
    > >>
    > >> Microsoft IT Academy Program Mentor
    > >> http://microsoftitacademy.com/
    > >>
    > >> Microsoft Registered Partner
    > >> https://partner.microsoft.com/
    > >>
    > >>
    > >> "Andreas" <Andreas@discussions.microsoft.com> wrote in message
    > >> news:8DC5BED7-6EEA-4DF7-8E43-56B1A17426FC@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!
    >
    >
    >
     
  6. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    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" <Andreas@discussions.microsoft.com> wrote in message
    news:D24FA1FA-D14A-4FA9-8CCE-15E7541F8CE0@microsoft.com...
    > 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" <Andreas@discussions.microsoft.com> wrote in message
    >> news:5F71BE82-8485-4314-94B6-4A56CB5E46A9@microsoft.com...
    >> > 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
    >> >> http://mvp.support.microsoft.com/
    >> >>
    >> >> Microsoft IT Academy Program Mentor
    >> >> http://microsoftitacademy.com/
    >> >>
    >> >> Microsoft Registered Partner
    >> >> https://partner.microsoft.com/
    >> >>
    >> >>
    >> >> "Andreas" <Andreas@discussions.microsoft.com> wrote in message
    >> >> news:8DC5BED7-6EEA-4DF7-8E43-56B1A17426FC@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!
     
  7. Andreas

    Andreas
    Expand Collapse
    Guest

    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" <Andreas@discussions.microsoft.com> wrote in message
    > news:D24FA1FA-D14A-4FA9-8CCE-15E7541F8CE0@microsoft.com...
    > > 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" <Andreas@discussions.microsoft.com> wrote in message
    > >> news:5F71BE82-8485-4314-94B6-4A56CB5E46A9@microsoft.com...
    > >> > 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
    > >> >> http://mvp.support.microsoft.com/
    > >> >>
    > >> >> Microsoft IT Academy Program Mentor
    > >> >> http://microsoftitacademy.com/
    > >> >>
    > >> >> Microsoft Registered Partner
    > >> >> https://partner.microsoft.com/
    > >> >>
    > >> >>
    > >> >> "Andreas" <Andreas@discussions.microsoft.com> wrote in message
    > >> >> news:8DC5BED7-6EEA-4DF7-8E43-56B1A17426FC@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!
    >
    >
    >
     

Share This Page