none
Date Picker With Week Numbers, Missing Tool...?, Access 2013 RRS feed

  • Question

  • Hi
    DATE PICKER with Week numbers
    Missing Tool...?

    QUOTE
    Do you want to enter week numbers, or just have them shown?

    just have them shown as it is in Outlook... lightbulb.gif
    I am working by WeekNumbers not by Days..


    DATE PICKER with Week numbers...Why ONLY for Date/Time fields....? confused.gif
    to enter/save (week numbers, Days,....) , i can use then MyFunc/Format$ for everything i wish...
    I want Pick a Date by Weeknumber, and save it in my format as 'YYYY WWD' in Text Field... iconfused.gif


    ACCESS

    Thursday, July 9, 2015 3:34 PM

Answers

  • Hi PACALA_BA,

    >> May be for Table/Forms, I need it for Table/Datasheet

    Do you mean that you want it for Table/Datasheet instead of Table/Forms? If so, it is impossible, as the reply from JoshTurnbull, the custom format does not support week level.

    If this is a feature you want to include in future versions of Access, please submit a feedback as picture below:

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Marked as answer by PACALA_BA Tuesday, July 14, 2015 11:35 AM
    Tuesday, July 14, 2015 10:08 AM

All replies

  • The custom format doesn't support week level (https://msdn.microsoft.com/en-us/library/aa231249(v=vs.60).aspx)

    Why do you need to store in that format in a text field? A date picker won't really help you there - your data should be in a date/time format so that the control can read it. What you should probably be doing is storing it as date/time and then using 'DatePart("ww", [DateValue])' to get the week number value if you need to display that to the user. It sounds like you're trying to overcomplicate things.


    Friday, July 10, 2015 1:51 PM
  • 2 things

    sometimes i want  save date as week/ or myWeek...in DATE/ or NOT-DATE FIELD  (DatePart("ww", [DateValue])...)

    but i want allways see WEEK-NUMBERS in DATE PICKER

    Why do you need to store in that format in a text field ?...I ++NEED++ IT, WHAT SHOULD I SAY


    ACCESS

    Friday, July 10, 2015 2:19 PM
  • Hi Pacala,

    It sounds like you're a little unsure about how data types work - the week number (and all other date intervals like month, day etc) can always be calculated from a date time value. There's never a good reason to store values that represent time in anything other than a date/time field, for the same reason you wouldn't store numeric values in a text field - in the latter case you can potentially lose the ability to perform mathematical operations and in the former case, your data loses all meaning as a date. Don't think of a date time field as a string in a 'dd/mm/yyyy' or whatever format, think of it as a single value representing a single point along a timeline. You don't want to make your data adjust to fit the formatting - that's what a UI is for - your data should represent values in the simplest possible way. You could put a calculated field in your table that creates the string you need based on the date/time field, but I wouldn't really recommend this course of action - just use controls on your form to format it how you need.

    You won't be able to get the date/time control to display week numbers as that's not what it was designed for and such a control would be very confusing to use, and you certainly won't be able to get it to read a string in the format 'YYYY WW DD'. The only solutions I can think of at the moment are either:

    Use a date/time picker to allow someone to pick a date with a control they're accustomed to, and have a text box near it that calculates the week number (I would recommend this as users won't need or want to pick a date based on a week number).

    OR

    Use combo boxes to display these values. Your week box will need to have a value list of numbers 1-54 (some years, e.g. 2000 can have 54 weeks), the day box will need 1-31 and the year box will need to be populated with a sensible list of years.

    Friday, July 10, 2015 3:03 PM
  • Hi

    There's never a good reason to store values that represent time in anything other than a date/time field,....

    NO, not ++NEVER++ a good reason , for the ++most++ cases it is true, but some ++exception++ are allways

    I would recommend this as users won't need or want to pick a date based on a week number...NOT TRUE for ME

    Yes , i can build my-Week-Box/Frm, but WHY NOT USE BUILT-IN-DATE/WEEK-PICKER....?

    In Outlook i SEE weeks....., +++ WHY not in Access....? +++




    ACCESS

    Friday, July 10, 2015 3:12 PM
  • Hi PACALA,

    >> I want Pick a Date by Weeknumber, and save it in my format as 'YYYY WWD' in Text Field

    At present, the DATE PICKER is only supported for picking a Date by Date/Time, it is not supported for picking a Date by WeekNumber. If you want to save the date with a Weeknumber in a Text Field, I think you could use the code below:

      Text26.Value = DatePart("yyyy", DTPicker5.Value) & "-" & DatePart("ww", DTPicker5.Value)

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Sunday, July 12, 2015 6:40 AM
  • PACALA,

    Does Edward's solution works for you?

    You might want to create a hidden TextBox for the DatePicker.

    txtHiddenDate - for the DatePicker set to Date/Time in Table/Forms.

    So, now with the Visible TextBox "Text26".......

    Text26 = DatePart("yyyy", txtHiddenDate) & "-" & DatePart("ww", txtHiddenDate) -- bound this to the Control Source (without the "Text26" of Course)

    The reason is this. You might want to go back into history for Reports. The DataType for Text26 would fail to tell what was the Date/Week No:

    So, you have something to hang on to.


    Monday, July 13, 2015 1:41 AM
  • Hi

    Thanks, ...May be for Table/Forms, I need it for Table/Datasheet...


    ACCESS

    Monday, July 13, 2015 4:03 PM
  • Hi PACALA_BA,

    >> May be for Table/Forms, I need it for Table/Datasheet

    Do you mean that you want it for Table/Datasheet instead of Table/Forms? If so, it is impossible, as the reply from JoshTurnbull, the custom format does not support week level.

    If this is a feature you want to include in future versions of Access, please submit a feedback as picture below:

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Marked as answer by PACALA_BA Tuesday, July 14, 2015 11:35 AM
    Tuesday, July 14, 2015 10:08 AM