How do you change this

  • Thread starter Thread starter ryan.fitzpatrick3
  • Start date Start date
R

ryan.fitzpatrick3

I have this in my code Const conJetDate = "\#mm\/dd\/yyyy\#"

Now, my database at work does things in weeks, which is odd I know but
that's how it goes. It'll groups up data like this 200801, which is
year 2008 week 1. How do I change the const conjetdate to = 200801
when I input that into a textbox.

normally you would put in 01/01/02008 and it would equal the above
const, but when I input 200801 in the text box it gives an error
"value is not valid".
 
Perhaps the underlying field is defined as a Date/Time field? "200801" is
NOT a valid date/time value.

But if you had an actual date in the first week of January, 2008 (?say,
January 4, 2008), you could use a function (DatePart()) to determine the
"week" of the year (= 1), then format a string that consists of the Year()
of the date/time value and the DatePart() value of that date, formatted as
"00".

No need to store "200801" unless there's more you have yet to describe.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top