473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How I store long date of datepicker control in access in the format-Friday,4 February

I am using Datepicker control and I change the format to dtpLongDate, therefore the date is looking like - Friday, 04 February. I want to store this long date in Access 2007. And in Access 2007 I already changed the format of date column to Long Date. I write a code for that which as follws -

rs.Open "insert into Table1(#"& DatePicker1.Value &"#)", con, adOpenStatic, adLockPessimistic

OR
rs.Open "insert into Table1("& CDate(DatePicker1.Value) &")", con, adOpenStatic, adLockPessimistic

This code stores the date without error but in backend(Access 2007) it look like ############### and after clicking on that particular cell of date column it shows 04/02/2011...... But i want in form Friday, 04 February. So then what will be right code for my this problem.
Mar 15 '11 #1
1 1808
Stewart Ross
2,545 Expert Mod 2GB
There is a difference between how you store a value and how you present that value. There is nothing wrong with the way Access is storing the value - it is correctly stored as a valid date/time value.

To show the value in the format you want you can either format the textbox in which you are displaying the value, or use the format function to set the format appropriately.

The format string for the textbox would be along the lines of dddd, dd mmmm.

The format function would be something like

Format([your field name goes here], "dddd, dd mmmm")

-Stewart
Mar 15 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: drishtik | last post by:
hi i am using the datepicker control to allow the user to choose a date and a time but can i do this in just one control? currently i have 2 controls 1 for date and 1 for time thanx
2
by: Mike L | last post by:
After the user enter in short date in text box, once the user tabs out of the text box I want the short date to change automatically to long date. What is the code to make this change and what is...
2
by: WJ | last post by:
Is there a DatePicker control in the current VS.Net (2003) other than the Calendar control ? If not, how can the current calendard control be minimized to a square 21x21px button (with graphic). ...
1
by: Luqman | last post by:
Where can I find DatePicker Control for VS.Net 2005, for Web Applications. Best Regards, Luqman
2
by: Klaus Jensen | last post by:
Hi! Can anybody recommend a nice datepicker-control, which works like the one for Windows forms? I need the combination of being able to enter a date manually (and have it validated) - and...
2
by: hardik | last post by:
hi friends, i am really surprized the way access behaves in date fields i mean it's all ok when you have us time zone or us servers but if you have diffrent timezone like uk then access creates...
0
by: Curious | last post by:
Hi, I have two columns defined as DateTime type in the Visual Designer, i.e., Dataset.xsd. In the grid to which the columns are bound, they're both displayed as date, for instance, 5/23/2007....
4
by: Curious | last post by:
Hi, I have a column in a grid defined as DateTime type. Currently, it's displayed in the format of "5/23/2007", for an example. It seems that it's using the default "short date" format. I...
0
by: =?Utf-8?B?VmFuY291dmVyTWlrZQ==?= | last post by:
Hi there, I have a web app written in 1.1 in ASP.net and C#. In the web app, I need to compare two dates (from and to) from two textboxes on webpage to make sure the to date is greater than or...
5
OuTCasT
by: OuTCasT | last post by:
Hi. I would like to know how to convert the short date format to the long date format for my application without changing the regional settings from short date to long date. ?
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.