473,809 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Date Help!

I have created an Excel spreadsheet that has a lot of data. What I
want to do is import the spreedsheet to Access and create a form so
that I can print each row per page in a proffessional manner. The
problem is that whenever I import the data to access my dates show up
in 38478 instead of 05/06/05. How can I convert this number back to
the date format in access?

Jun 6 '07 #1
8 2907
On Wed, 06 Jun 2007 08:42:19 -0700, sa*********@gma il.com wrote:
I have created an Excel spreadsheet that has a lot of data. What I
want to do is import the spreedsheet to Access and create a form so
that I can print each row per page in a proffessional manner. The
problem is that whenever I import the data to access my dates show up
in 38478 instead of 05/06/05. How can I convert this number back to
the date format in access?
That value of 38478 is a date value (it's 5/6/2005).
Access stores dates a Double datatype number, being a count of days
from 12/30/1899.

All you need do is set the format property of the field/control to
m/d/yyyy
to display the value as 5/6/2005.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jun 6 '07 #2
On Jun 6, 9:57 am, fredg <fgutk...@examp le.invalidwrote :
On Wed, 06 Jun 2007 08:42:19 -0700, saladina...@gma il.com wrote:
I have created an Excel spreadsheet that has a lot of data. What I
want to do is import the spreedsheet to Access and create a form so
that I can print each row per page in a proffessional manner. The
problem is that whenever I import the data to access my dates show up
in 38478 instead of 05/06/05. How can I convert this number back to
the date format in access?

That value of 38478 is a date value (it's 5/6/2005).
Access stores dates a Double datatype number, being a count of days
from 12/30/1899.

All you need do is set the format property of the field/control to
m/d/yyyy
to display the value as 5/6/2005.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Fred thanks for your help. I appologize but my Access knowledge is
just now blossoming. Where do I go to do what you told me? How do I
set the format property? Thanks so much for your help.

Jun 6 '07 #3
On Wed, 06 Jun 2007 09:09:14 -0700, sa*********@gma il.com wrote:
On Jun 6, 9:57 am, fredg <fgutk...@examp le.invalidwrote :
>On Wed, 06 Jun 2007 08:42:19 -0700, saladina...@gma il.com wrote:
>>I have created an Excel spreadsheet that has a lot of data. What I
want to do is import the spreedsheet to Access and create a form so
that I can print each row per page in a proffessional manner. The
problem is that whenever I import the data to access my dates show up
in 38478 instead of 05/06/05. How can I convert this number back to
the date format in access?

That value of 38478 is a date value (it's 5/6/2005).
Access stores dates a Double datatype number, being a count of days
from 12/30/1899.

All you need do is set the format property of the field/control to
m/d/yyyy
to display the value as 5/6/2005.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Fred thanks for your help. I appologize but my Access knowledge is
just now blossoming. Where do I go to do what you told me? How do I
set the format property? Thanks so much for your help.
In your Table?
Open the Table in Table Design View.
Select the Date field.
In the lower panel is the Format property line.
On that line, write:
m/d/yyyy
Save the changes.

On your form?
Open the Form in Design View.
Select the Date control.
Right-click and select Properties.
On the property sheet Format tab, find the Format line.
Write
m/d/yyyy
on that line.
Save the changes.

That's to show dates in the format of 6/5/2007.
Look up
Format + Format Property - Date/Time Data Type
in Access help to see the various different date formats available.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jun 6 '07 #4
On Jun 6, 11:20 am, fredg <fgutk...@examp le.invalidwrote :
On Wed, 06 Jun 2007 09:09:14 -0700, saladina...@gma il.com wrote:
On Jun 6, 9:57 am, fredg <fgutk...@examp le.invalidwrote :
On Wed, 06 Jun 2007 08:42:19 -0700, saladina...@gma il.com wrote:
I have created an Excel spreadsheet that has a lot of data. What I
want to do is import the spreedsheet to Access and create a form so
that I can print each row per page in a proffessional manner. The
problem is that whenever I import the data to access my dates show up
in 38478 instead of 05/06/05. How can I convert this number back to
the date format in access?
That value of 38478 is a date value (it's 5/6/2005).
Access stores dates a Double datatype number, being a count of days
from 12/30/1899.
All you need do is set the format property of the field/control to
m/d/yyyy
to display the value as 5/6/2005.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Fred thanks for your help. I appologize but my Access knowledge is
just now blossoming. Where do I go to do what you told me? How do I
set the format property? Thanks so much for your help.

In your Table?
Open the Table in Table Design View.
Select the Date field.
In the lower panel is the Format property line.
On that line, write:
m/d/yyyy
Save the changes.

On your form?
Open the Form in Design View.
Select the Date control.
Right-click and select Properties.
On the property sheet Format tab, find the Format line.
Write
m/d/yyyy
on that line.
Save the changes.

That's to show dates in the format of 6/5/2007.
Look up
Format + Format Property - Date/Time Data Type
in Access help to see the various different date formats available.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail- Hide quoted text -

- Show quoted text -
AHH!! Thank you very much sir!
\

Jun 6 '07 #5
On Jun 6, 11:57 am, saladina...@gma il.com wrote:
On Jun 6, 11:20 am, fredg <fgutk...@examp le.invalidwrote :


On Wed, 06 Jun 2007 09:09:14 -0700, saladina...@gma il.com wrote:
On Jun 6, 9:57 am, fredg <fgutk...@examp le.invalidwrote :
>On Wed, 06 Jun 2007 08:42:19 -0700, saladina...@gma il.com wrote:
>>I have created an Excel spreadsheet that has a lot of data. What I
>>want to do is import the spreedsheet to Access and create a form so
>>that I can print each row per page in a proffessional manner. The
>>problem is that whenever I import the data to access my dates show up
>>in 38478 instead of 05/06/05. How can I convert this number back to
>>the date format in access?
>That value of 38478 is a date value (it's 5/6/2005).
>Access stores dates a Double datatype number, being a count of days
>from 12/30/1899.
>All you need do is set the format property of the field/control to
>m/d/yyyy
>to display the value as 5/6/2005.
>--
>Fred
>Please respond only to this newsgroup.
>I do not reply to personal e-mail
Fred thanks for your help. I appologize but my Access knowledge is
just now blossoming. Where do I go to do what you told me? How do I
set the format property? Thanks so much for your help.
In your Table?
Open the Table in Table Design View.
Select the Date field.
In the lower panel is the Format property line.
On that line, write:
m/d/yyyy
Save the changes.
On your form?
Open the Form in Design View.
Select the Date control.
Right-click and select Properties.
On the property sheet Format tab, find the Format line.
Write
m/d/yyyy
on that line.
Save the changes.
That's to show dates in the format of 6/5/2007.
Look up
Format + Format Property - Date/Time Data Type
in Access help to see the various different date formats available.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail- Hide quoted text -
- Show quoted text -

AHH!! Thank you very much sir!
\- Hide quoted text -

- Show quoted text -
Ok so I did everything that you told me and when I try to save it it
deletes the data instead of converting it. What could be causing this
problem?

Jun 6 '07 #6
What is happening is that your table is expecting a date value in
dateformat. You need to convert the Excel date number to a date value
before inserting it into the table:

Function ConvertNumericT oDate(s1 as String) As Date
ConvertNumericT oDate = Format(s1, "mm/dd/yyyy")
End Function

Here is a way to call your function:

Sub CallDateFuction ()
Dim str1 As string
str1 = 38478
Debug.Print ConvertNumericT oDate(str1)
End Sub

and this will display 5/6/2005 in the Immediate window.

Now Add this function to a standard code module in Access (not a form
code module)

So When you import your data from Excel you can add a date column to the
Import Table and use an Update Query and apply the function above like
this:

In the Update Query Design View add your import table and then select
your new date field to be updated. In the Update To: cell enter this:

Update To: ConvertNumericT oDate(yourTbl.Y ourNumericDatef ld)

(change yourTbl to the actual name of your import table and
YourNumericDate fld to the actual name of the field that contains the
numeric dates). Then run the query. Now all the numeric date values in
the numeric column will appear as the correct date values in the new
date column (they will still be numeric in the numeric import column).

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jun 6 '07 #7
On Jun 6, 4:03 pm, Rich P <rpng...@aol.co mwrote:
What is happening is that your table is expecting a date value in
dateformat. You need to convert the Excel date number to a date value
before inserting it into the table:

Function ConvertNumericT oDate(s1 as String) As Date
ConvertNumericT oDate = Format(s1, "mm/dd/yyyy")
End Function

Here is a way to call your function:

Sub CallDateFuction ()
Dim str1 As string
str1 = 38478
Debug.Print ConvertNumericT oDate(str1)
End Sub

and this will display 5/6/2005 in the Immediate window.

Now Add this function to a standard code module in Access (not a form
code module)

So When you import your data from Excel you can add a date column to the
Import Table and use an Update Query and apply the function above like
this:

In the Update Query Design View add your import table and then select
your new date field to be updated. In the Update To: cell enter this:

Update To: ConvertNumericT oDate(yourTbl.Y ourNumericDatef ld)

(change yourTbl to the actual name of your import table and
YourNumericDate fld to the actual name of the field that contains the
numeric dates). Then run the query. Now all the numeric date values in
the numeric column will appear as the correct date values in the new
date column (they will still be numeric in the numeric import column).

Rich

*** Sent via Developersdexht tp://www.developersd ex.com***
Rich thanks for your help. If you could can you explain to me how and
where I need to call this function. I am still trying to pick all of
this excel and access stuff up.

Jun 7 '07 #8
Go to the module section. Create a new module and just paste this code
in there and save it - you can save the module as any name.

Function ConvertNumericT oDate(s1 as String) As Date
ConvertNumericT oDate = Format(s1, "mm/dd/yyyy")
End Function

Now go to the table you just imported from Excel. Add a new column and
make it a DateTime type. This column will be empty, but you are going
to update that column with the data from the Numeric Date column from
Excel.

Then go to the Queries section and open a new query in design view. Add
the table you just imported from Excel. Now go to the Query Menu at the
top of the Query Design view. Select "Update Query". Now, from the
Table in the Query Design view - scroll that table till you see your new
Date Column and drag your new Date column to the Field section in the
Query Design view. Place the Column in the cell next to "Field:" This
should automatically add the name of the Table in the "Table:" cell just
below the "Field:" cell.

Now go to the cell next to "Update To:" which is immediately below the
"Table:" cell

Here is where you type this:

ConvertNumericT oDate(theTableN ame.yourDateFie ldName)

replace theTableName with the actual table Name and replace
yourDateFieldNa me with the name of the actual Date field. Make sure you
type the tableName - period - DateFieldName

tblWhatever.Dat eFieldWhatever

Make sure this is inside parentheses after the Function Name

ConvertNumericT oDate(tblWhatev er.DateFieldWha tever)

That is what you type in the "Update To:" cell

Save the query and run it. This will update your new Date Column with
the Date value of the Numeric Dates.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jun 7 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7831
by: Jay | last post by:
I previously posted this question under Visual Basic newsgroup, but was advised to re-post here. I'm hoping someone can help me solve an issue I'm having with VB.Net and Access 2000. Here's the issue. I hope I've included all relevant information. On a form, I have a DateTimePicker with the following
1
8185
by: mark | last post by:
In Access 2000 and 2002, I have created an import specification to import the fixed-width recordset below into an existing table. I am having strange problems with the import of the date and time fields. 177 102003 16:43:12 102003 18:43:12 6OAG0ADP Y 0000 0000 0000 0000 61930 4HGA800 165 102003 17:43:12 102003 18:44:12 6OAG0ADP Y 0000 0000 0000 0000 61930 4HGA800 177 102003 16:41:18 102003 18:45:12 6OAG0ADP Y 0000 0000 0000 0000 61930...
0
1495
by: Manystrengths | last post by:
I must warn all of you willing to help me that this is my first go at designing a functional data access page. Please bear in mind that we all start somewhere so if I should be asking the absolute dumbest questions you've heard in a while remember I'm not the first. I am specifically looking for step by step direction. I also feel I must make you aware of my dedication. You see, I need to complete this project to get a nice bonus for...
5
1826
by: Kissi Asiedu | last post by:
I am trying to find a way to append data from a user into a table using Code module. Here is an example: I have a table "SHORTS" and fields "DATE" and "SHORT". I wrote the code below but access won't recognize the fields. Can some one Help please. Dim strShorts as Sting Dim dtShort as Date dtDhort = Date strShorts = inputbox ("Enter Shorts", "Today's Shorts") ! = dtShort ! = strShorts
1
5168
by: Brad | last post by:
Thanks for taking the time to read my question. I have a table of data that has Date, Data and Category. I need to show, in a report, each Categories Data by Date. The Date has to be it's own column across the top and Category down the left side. As data is entered, the number of unique dates increases. As a result the
4
1722
by: Takeadoe | last post by:
Hey Gang, I'm gearing up to retool for the upcoming deer season here in Ohio and I could use some help with very general questions about direction. I will be scanning nearly 210,000 forms that capture deer harvest information. We use Verity's Teleform V9 enterprise to capture the scanned data. To date, I've not done any scripting (essentially VBA) and have not set up any real fancy rules during verification. If there are bad or missing...
1
1701
by: Jamad | last post by:
I want to extract some information in a text file that is not tab, comma and space separated. The format of the text file is actually unknown. The problem now is, i want to extract like three lines from each section of the text file content, break the lines into different part and use the broken info to populate an already created table in ms access ( all these should be carried out at a press of a cmd button using VBA code in access or VB...
1
8995
by: cpajoe2001 | last post by:
I am having an issue and after searching around online for a day and half now and finding others with the same problem but yet no solution to my issue I am looking for help. What i have is ServerA which is a webserver running Win2k3 with IIS6, my domain account is a local administrator on this machine. The web app I am running is trying to write a file to ServerB which is also a Win2k3 machine. On the folder of the machine I am writing to...
6
6226
by: Mark | last post by:
Currently using MS Access 2000 and SQL Server Express. Using the current DAO OpenRecordset code listed below, however I keep getting the error message.... 3254: ODBC --Cannot lock all records The code below runs in a MS Access frontend while the table is linked using an ODBC connected to an SQL Server (backend). The table (located in SQL) only has one row and one column within it . I want to try and stop any other request (other...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10378
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7653
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3013
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.