473,800 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

load with date format

I have date values in mm/dd/yy format in a text file. How can use the
LOAD command or mysqlimport command and load those date values.
Currently I just load the date values as text into MySQL tables and
manipulate the text in applications. There must be a better way? can I
use DATE_FORMAT or something like that?
Thanks,
Yasaswi

Jul 23 '05 #1
2 5495
yasaswi wrote:
I have date values in mm/dd/yy format in a text file. How can use the
LOAD command or mysqlimport command and load those date values.
Currently I just load the date values as text into MySQL tables and
manipulate the text in applications. There must be a better way? can I
use DATE_FORMAT or something like that?


DATE_FORMAT is only for formatting dates on output.

MySQL will not accept mm/dd/yy format for input of DATE data. You must
use YYYY-MM-DD or YY-MM-DD. See
http://dev.mysql.com/doc/mysql/en/DATETIME.html for more information.

If you need to use another format, your only option is what you have
done: use a text datatype instead of a DATE datatype for storage. But
this prevents you from treating the value as a date value, which means
you can't use the builtin functions in MySQL for operating on date values.

Regards,
Bill K.
Jul 23 '05 #2
Bill Karwin wrote:
If you need to use another format, your only option is what you have
done: use a text datatype instead of a DATE datatype for storage. But
this prevents you from treating the value as a date value, which means
you can't use the builtin functions in MySQL for operating on date values.


But he could write SQL script to convert the text to date from one
column to another column by using string functions. For example cutting
substrings from the source and pasting those in correct order for date.
Jul 23 '05 #3

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

Similar topics

8
11144
by: Ray in HK | last post by:
Will it be possible to specify the date format of type DATE during data loading ?
9
4321
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target data format is european DD.MM.YYYY (for days) and 01.MM.YYYY (for months). The input format is not recognizable as a DATE input to a DB2 LOAD for
2
2983
by: Uthuras | last post by:
Greetings all, Machine : PENTIUM Os :Windows 2000 Product : DB2 UDB EE Release : 7.2 I've extracted data from a RDBMS database and try to load into DB2 database. I extracted the data in the form of delimited ASCII format. The separator for each colum is '|'
2
1412
by: Ayoa | last post by:
In my web based reporting program, reports are generated by passing parameters to an aspx page (which runs a database query and does XSL transformation). For example:
13
26622
by: Thom Little | last post by:
My first ASP.NET application on Visual Studio 2005 and .NET Framework 2.0 The application compiles and executes correctly on the development machine. I then publish it to an empty directory on the development machine. I then copy that directory to the remote server that contains numerous directories and some of them are using .NET Framework 1.1 (1.1 and 2.0 are both installed on the server). When I call the page I get the message ...
12
29475
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as follows: function doDateCheckNow(source, args) { var oDate = document.getElementById(source.controltovalidate); // dd/mm/yyyy
14
4448
by: peteh | last post by:
Hi All; We have many production jobs that "load from cursor" to a UDB/AIX 8.2 (with dpf) data warehouse from source tables residing Oracle 9i. Since Oracle dates are (roughly) equivalent to DB2 timestamps, we frequently use the date() function to "convert" from the Oracle date datatype to the DB2 date datatype. We have used this technique on over 20 Oracle tables for several months with no problem. One table in particular fails with a...
1
11153
by: mrabinovich | last post by:
Hello, I have Julian date in format YYDDD in the load file. A column in the table to be loaded has regular date format. I am using IBM load utility. How can I convert data? (In JCL before Load I can put some logic to modify Julian date field to YYYYDDD) Thank you very much. Mike
0
2342
by: SB41093 | last post by:
Hi, I am trying to populate date and time into DB2 table using DB2 load utility script. The date coming from source is in the format of YYYY-MM-DD and the time in the form of hh:mm:ss i am using the following utility script to perform the operation: db2 LOAD CLIENT FROM <source filename> OF ASC modified by identitymissing dateformat="YYYY-MM-DD" timeformat="HH:MM:SS" striptblanks reclen=32 method L (1 12,13 13,14 24,24 32)...
0
9695
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...
0
10514
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10287
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
10260
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
10042
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
7588
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
5479
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
4156
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
3
2956
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.