Changing the date format in Access 2010 - ms-access

I want to show the Purchase_Date in dd/mm/yy format . I already set the Format in form properties as dd/mm/yy
When i select a cell in database view it shows the date in dd/mm/yy but it still shows the date in mm/dd/yy otherwise
I need 05/02/14 to show as 02/05/14 at all times

This is by design. When the control gets focus, it will revert to the default format as to the settings in Windows.
A workaround can be to use three concatenated textboxes, but it requires some code to operate nicely.

You have to go to the Region and Language in the Control Panel and choose "English (Autralia)" as the format in the formats tab. Then change the short date format from the option below as you require. The format you want is available there.
Edit:
A better way to do it is to apply your own format. In the Format property of the properties of the Date/Time field, you can type in the format you want using placeholders and separators.
Hope this solves your problem.

Related

dd/mm/yyyy date format in SSRS

i'm trying to specify dd/mm/yyyy dateformat for date/time parameter in SSRS 2008 R2.
My computers datetime format is mm-dd-yyyy.
My requirement is, i want to show date format at dd/mm/yyyy irrespective of the system/server date format.
I've already tried CDate(Format(Today,"dd/mm/yyyy")) which didn't work. one very strange thing i observed is, it shows dd/mm/yyyy format only for dates on or before 12-MM-yyyy, and 13 onwards it gives error: Conversion from string '25-04-2014' to type Date is not valid. (Possibly it is trying to map 25(daypart) with MM-dd-yyyy (month part)) which is out of range of total months i.e. 12)
my research on internet says it is a bug in BIDS 2008.
What do i do to display date as dd/mm/yyyy ??
I don't have enough reputation to comment, but I did notice that you failed to put "()" after "Today". If I'm not mistaken you must put Today() for that function to work. Also, you might want to try putting CDate Around the Today() function. You shouldn't need it, but it's worth a shot. Also, for some odd reason, in my experience, you must capitalize MM for format to work correctly.
Like #Aditaya said, it should be =format(Today(),"dd/MM/yyyy")
The expression I usually use is:
=FormatDateTime(Fields!Date.Value, DateFormat.ShortDate)
However, this may be region specific.
Rather than writing an expression to do the formatting, you can also use the Textbox Format Property. But first you need to make sure that the data is in a date format. So use the CDate function on your column like this:
=CDate(Fields!Date.Value)
Then in the textbox properties go to the Number tab. Select Date for the category. Then you can select whichever format you want or use a Custom format. This will change how the column displays when you run the report.

Access Report Show # instead of Date

My access report is showing ##### instead of showing the datetime value in the row. When I clicks on it the ##### turn outs to the actual date as if it was hidden behind it. I have tried changing the date format to Long Date Medium Date and Short Date in both the related table as well as in the report's Format properties but is it not working at all.
Why is it so?
The problem you have can be because there's no enough space in the textbox (or other control) to display the value you need.
You can solve this by either increasing the size of the control or decreasing the size of the font you are using.
An alternative can be to convert the value you want to display into a string. Since you are dealing with dates, I sugest you use the format$() function. For example:
=format$([yourDateField],'yyyy-mm-dd')
will return a date in the year-month-day format. Check the online help to know more about this function.
Hope this helps you

Date format with VBA - English VS French difference

I have a problem with Access 2010. I'm using the included datepicker with the default textbox.
Where i work, there are computers that are in US date format (mm/dd/yyyy), and others in Canada date format (dd/mm/yyyy)
I cannot change the regional option of those computers.
I have succeded to force the date with format(date,"dd/mm/yyyy")
But when i chose a date with the default datepicker, it goes with the windows regional option, in this case, (mm/dd/yyyy) but in other computer, it will be ok, in (dd/mm/yyyy). I need to overide the dateformat with the datepicker but i don't know how.
This is a screenshot, the dateformat is in US format, and it's not okay.
I'm sure there's a more elegant way to do this, but I guess you could detect the locale-determined date format with something like this:
If CInt(Left(CStr(DateSerial(2012, 1, 2)), 2)) = 2 Then
MsgBox "Canadian locale, date format dd/mm/yyyy."
Else
MsgBox "US locale, date format mm/dd/yyyy."
End If
Then based on this, interpret the date-picker-chosen date and re-display it in your format of choice.
Can you not just set the Format property of the text field to dd/mm/yy or whatever you require?

Data Type Error when added Input Mask on Date Time Field

i have a date/time field called MyDate. Originally, its format is mm/dd/yyyy and there is no input mask. The Date Picker is also set. I then added input mask using Short date , changed the default input maks to (99-99-0000;;_) and change the format to mm-dd-yyyy. However, when i switch to DataSheet view , all my dates are changed from mm/dd/yyyy to mm-dd-yyyy (which is the correct behaviour right? ) and when I tried to enter a new date or modify existing date, it says "The value you entered does not match Date/Time data type in this column". Plus, the DatePicker is missing. How can I resolve this. thank you
The date time picker is not available if an input mask is applied to a field: http://office.microsoft.com/en-us/access-help/add-and-customize-date-and-time-formats-HA010078108.aspx#_Toc272229486
Regarding the error, have you considered using your regional settings in the control panel, which sets the defaukt date display for all (most?) applications?
Dates in Access are stored as numbers, so you can format them however you like, but I suspect the input mask may need to match the regional settings, although I am not certain.

Date prompt in BO

I have a webi report that accepts a date input.
I need to receive data from the user in the format "dd-Mmm-YYYY"; however the calendar control that BO presents to the user for date selection is always shown in M/DD/YYYY HH:MM:SS AM/PM.
Is there any way to control this behaviour?
Have you tried changing all the date fields in the Universe designer to the format that you want? You can either format them using SQL in the select statement box of the "Object Properties", or you can change the format of the field by right clicking and selecting "Object Format..."
I'm pretty sure that would affect the way the end user sees it.
you can set the date format (and all other format ) on the locatizion parametrs on the user setting for each user you have in cms , simply by the infoview preferences for each user .
home screen of central management -> preferences - > Preferred Viewing Locale + local time zone.
or
home screen of infoview -> preferences - > Preferred Viewing Locale + local time zone.
this will set also the date prompt format
There's another option.
On the BO server there's a javascript file that is used to create the calendar popup.
..\Tomcat55\webapps\AnalyticalReporting\viewers\cdz_adv\lib\calendar.js
Inside this file there's a function called CTFB_setFormatInfo which if passed a date format uses it ... if not there's seems to be a hard coded default of "MM/dd/yyyy hh:mm:ss a".
I'm pretty certain this is not updated by the other dozen ways to set the date format found in BO (user prefs, prn file, object properties ect).
function CTFB_setFormatInfo(format,arrDays,arrMonth,AM,PM)
{
var o=this
o.arrMonthNames=arrMonth?arrMonth:_month
o.arrDayNames=arrDays?arrDays:_day
o.format=format?format:"MM/dd/yyyy hh:mm:ss a"
o.AM=AM?AM:_AM
o.PM=PM?PM:_PM
}
I just updated this file - and now I get consistent dd/mm/yyyy - without pesky mm/dd/yyyy randomly turning up when the preference isn't passed through.