Re: Update query with DatePart() problem



You've left out the " characters to delimit the strings in the first
argument for the DatePart function:

UPDATE [Task frequencies] SET [Task frequencies].[Current period] =
DatePart("yyyy",Date())*1000+DatePart("y",Date())*[Task frequencies].[Day
span];

--

Ken Snell
<MS ACCESS MVP>


"MarkB" <MarkB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C8E220A2-C4D8-4D4C-814A-5DC035A4959E@xxxxxxxxxxxxxxxx
>I have created a query that is supposed to update a field (current period)
>to
> a value based on the current date and the (Day span) field which contains
> non-zero values. The problem is that all results are zero.
>
> UPDATE [Task frequencies] SET [Task frequencies].[Current period] =
> DatePart(yyyy,Date())*1000+DatePart(y,Date())*[Task frequencies].[Day
> span];
>
> What am I doing wrong?
>


.



Relevant Pages

  • Re: Quote-aware string splitting
    ... Oh, and if your strings may span more than one line, replace re.VERBOSE ... George ... Prev by Date: ...
    (comp.lang.python)
  • Re: Date Calculations
    ... >Lynn Trapp ... >MS Access MVP ... >> original day# which does not happen if the 3 year span ... >> includes a leap year. ...
    (microsoft.public.access.queries)