date stuff

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to get two fields [year] yyyy and [dayofyear] (julian date) y into one field [date] yyyymmdd everything that i have tried has ended up -

thanks jamie
 
Try this:
DateAdd("d", [DayOfYear], DateSerial([YearField], 1, 0))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

jamie said:
I am trying to get two fields [year] yyyy and [dayofyear] (julian date) y
into one field [date] yyyymmdd everything that i have tried has ended up -1
 
After inseting this line into my update query it is asking for user input. dayofyea

UPDATE [ClimDB temp Table] SET [ClimDB temp Table].[date] = DateAdd("d",[DayOfYear],DateSerial([Year],1,0))

Where would this line go? Currently i have a table the has the field [year] and the field [dayofyear] and they need to be merged into a field that looks like yyyymmdd i have been working with an update query to do this. is this correct

jamie
 
If Access is asking for user input for "dayofyear", it means it cannot find
a field with that name.

Do you have spaces or something else in that field name, e.g. [Day Of Year]
?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

jamie said:
After inseting this line into my update query it is asking for user input. dayofyear

UPDATE [ClimDB temp Table] SET [ClimDB temp Table].[date] = DateAdd("d",[DayOfYear],DateSerial([Year],1,0));

Where would this line go? Currently i have a table the has the field
[year] and the field [dayofyear] and they need to be merged into a field
that looks like yyyymmdd i have been working with an update query to do
this. is this correct
 
So today i tried to run it and this time i get a compile error, in expression. This seems like a very simple issue and i have spent much to much time working on it?

thanks for the hel
jamie
 
If you are sure your expression is correct, it may be worth checking your
references:
http://allenbrowne.com/ser-38.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

jamie said:
So today i tried to run it and this time i get a compile error, in
expression. This seems like a very simple issue and i have spent much to
much time working on it?
 
Back
Top