473,779 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert Access dates to Oracle format

Hi,

I am writing to a text file the records in an access table that is to
be loaded into an Oracle system.

However, I have been told that the date fields in the records I have
exported to the text file that are not compatible with oracle. The
format looks like: 01/01/2006 and I need it to look like 01-JAN-2006.

I have tried using the format function and the variable still shows it
as 01/01/2006.

The text file is generated by clicking from a button on a form which
contains the string/date variables and a loop with the write lines. I
am not on my work PC at the minute so can't show what I've created, but
can post it later if needed.

Can anyone give me an idea of how to get this sorted.

Cheers.

Jan 26 '06 #1
5 6529
Gox
Try this function:

Function ToAmDate(dDatum As Variant) As Variant
If IsNull(dDatum) Then
ToAmDate = Null
Exit Function
End If
ToAmDate = LTrim(str(Day(d Datum))) & "-" &
LTrim(str(Month (dDatum))) & "-" & LTrim(str(Year( dDatum)))
End Function
ca**********@ne wcastle.gov.uk wrote:
Hi,

I am writing to a text file the records in an access table that is to
be loaded into an Oracle system.

However, I have been told that the date fields in the records I have
exported to the text file that are not compatible with oracle. The
format looks like: 01/01/2006 and I need it to look like 01-JAN-2006.

I have tried using the format function and the variable still shows it
as 01/01/2006.

The text file is generated by clicking from a button on a form which
contains the string/date variables and a loop with the write lines. I
am not on my work PC at the minute so can't show what I've created, but
can post it later if needed.

Can anyone give me an idea of how to get this sorted.

Cheers.

Jan 26 '06 #2
Thanks for the response. However it still returns the month as a
number and not in character form e.g. 24-11-2004 instead of 24-NOV-2004

Can you help again?

Cheers.
Gox wrote:
Try this function:

Function ToAmDate(dDatum As Variant) As Variant
If IsNull(dDatum) Then
ToAmDate = Null
Exit Function
End If
ToAmDate = LTrim(str(Day(d Datum))) & "-" &
LTrim(str(Month (dDatum))) & "-" & LTrim(str(Year( dDatum)))
End Function
ca**********@ne wcastle.gov.uk wrote:
Hi,

I am writing to a text file the records in an access table that is to
be loaded into an Oracle system.

However, I have been told that the date fields in the records I have
exported to the text file that are not compatible with oracle. The
format looks like: 01/01/2006 and I need it to look like 01-JAN-2006.

I have tried using the format function and the variable still shows it
as 01/01/2006.

The text file is generated by clicking from a button on a form which
contains the string/date variables and a loop with the write lines. I
am not on my work PC at the minute so can't show what I've created, but
can post it later if needed.

Can anyone give me an idea of how to get this sorted.

Cheers.


Jan 26 '06 #3
Gox
Try this:

Function ToAmDate(dDatum As Variant) As Variant
If IsNull(dDatum) Then
ToAmDate = Null
Exit Function
End If
ToAmDate = Format(CDate(dD atum), "dd-mmm-yyyy")
End Function

ca**********@ne wcastle.gov.uk wrote:
Thanks for the response. However it still returns the month as a
number and not in character form e.g. 24-11-2004 instead of 24-NOV-2004

Can you help again?

Cheers.

Jan 26 '06 #4
Works a treat.

Cheers.

Jan 26 '06 #5
ca**********@ne wcastle.gov.uk wrote:
Thanks for the response. However it still returns the month as a
number and not in character form e.g. 24-11-2004 instead of 24-NOV-2004


I'm curious as to why your Oracle admin isn't using that most basic of
Oracle concepts, the date picture.

Gox is giving you good functions, but in reality, you DON'T NEED THEM!!!!

to_date('column _with_access_da te', 'dd/mm/yyyy')

To illustrate this, execute the following in SQL Plus (the Oracle guys
will know what this is):

SQL> select to_date('24/11/2004', 'dd/mm/yyyy') from dual;

TO_DATE('
---------
24-NOV-04

SQL>

A good Oracle admin should know how to use SQLLDR and a control file to
take your text file into Oracle. Part of the control file will use a
proper date picture to deal with any kind of date.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Jan 26 '06 #6

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

Similar topics

4
5390
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and calculate days, months, and years. This is not for a college course. It's for my own personal genealogy website. I'm stumped about the code. I'm working on it but not making much progress. Is there any free code available anywhere? I know it...
9
1905
by: Neil | last post by:
I have been coding with ASP for some time now. I am using an ACCESS database. I am in the UK and wish to use DD/MM/YYYY format for dates. I have had no end of problems and possible solutions to dates such as 1/8/05 being interpreted in the wrong way. I have been given many suggestions (setting LCID, submitting dates in long format etc. etc.) Is there any definitive sloution or tutorial available? This is driving me
2
4239
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with this. Also - the citrix folks do not want us to keep the FE in Access as the queries and other activities consume a lot of power. The users will be in 3 different offices across the globe all accessing the 1 Oracle DB in Citrix. Does anyone have...
5
2565
by: Henning M | last post by:
Hi all, I having some problems with Access and selecting records between dates.. When I try this in access, it works fine!! "Select * from Bilag Where Mdates Between #1/1/2006# And #31/1/2006#" But when I try it from my vb.net app, I get ALL the records in the tabel?? What goes wrong? I haven't been able to find any info on the net, besides others having
4
39345
by: perryclisbee via AccessMonster.com | last post by:
I have dates of service for several people that range all over each month. ie: patient had dates of service of: 7/3/2006, 7/24/2006 and 7/25/2006. I need to create a new field via a query that will convert each of the records of these service dates to the first date of that month, with results showing: 7/1/2006, 7/1/2006, 7/1/2006. How would you place an expression on a query that will convert any given date to the first day of the month...
2
21109
by: Kakishev | last post by:
I have a problem at how best to convert a Date into a text field and keep the format dd/mmm/yyyy (01-FEB-2007). The problem is that dates are imported from SQL into an access front end Database. When the dates are imported they are in the format dd/mm/yyyy. However on the reports the dates are in the in the format dd/mmm/yyyy. I now need to allow the fields to accept an asterix (*) as a prefix to the date to show dates that have not...
6
3015
by: tshad | last post by:
Apparently, I can't do: Dim da2 As New OleDb.OleDbDataAdapter("Select PR, Convert(varchar,getchar(),1),F1, F2, F5, Sum(F4) from temp .... I am getting this error. 'undefined function "convert" in expression'
5
3014
by: WPW07 | last post by:
Hello, We have several complex applications developed in Access 2003 by various outside consultants. These applications link to a variety of Oracle tables and are used only for Access reports. User level security is also built in via the mdw workgroup file for all applications. I've been asked to research how viable it is to convert all of these applications to Access 2007. I understand 2007 discontinued user
1
1318
by: magicscreen | last post by:
I am trying to create a CSV export file that has a date field. If you look at the table in Access the date looks like mm/dd/yyyy. I want to run the export wizard to create a spec so I can use it in a Transfertext. I am trying to convert the date to dd-mm-yyyy. I selected the - as the separator and the format as DMY. When I look at the exported file, some dates are MM/DD/YYYY and some dates are DD-MM-YYYY.
0
9471
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10071
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
9925
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...
1
7478
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
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5372
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...
1
4036
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.