473,467 Members | 1,291 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Column formatting

Hi

Being new to mysql I have some queries about formatting a date column

1. Can I use dd-mm-yy, my website is Australian

2. Can I leave the date field in one row empty if the date is unknown.

3. If I only know the year an event took place, can I enter just the
year.

4. Would it be best if I used varchar for the column

thanks in advance for any help

Patricia May
Jul 20 '05 #1
2 1725
Patricia May wrote:
1. Can I use dd-mm-yy, my website is Australian
This page will propably answer many to your questions:
http://dev.mysql.com/doc/mysql/en/Da...functions.html

See for example DATE_FORMAT(date,format) function which you can use to
get dates in any format you like, from database. For inserting dates,
there are several methods, depends on your MySQL version what to use,
but you should find all that from the url I gave.
2. Can I leave the date field in one row empty if the date is unknown.
You can enter null date if your column type allows nulls.
3. If I only know the year an event took place, can I enter just the
year.
Not really if you are using the date column. You would have to give a
full date and then for example use extra column to flag that only year
is true.
4. Would it be best if I used varchar for the column


No. varchar instead of date when dates are used is really a pain in the
ass if you are doing fixes for some old programs, never do that please,
things are a lot easier with date.
Jul 20 '05 #2
On Wed, 08 Sep 2004 04:45:10 GMT, Aggro <sp**********@yahoo.com>
wrote:
Patricia May wrote:
1. Can I use dd-mm-yy, my website is Australian


Thanks for your advice, I have checked out the page below and I find
it confusing, however I will learn ....

Patricia May
This page will propably answer many to your questions:
http://dev.mysql.com/doc/mysql/en/Da...functions.html


Jul 20 '05 #3

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

Similar topics

6
by: Marek Kotowski | last post by:
I need to put current date into additional column title. I mean something like this SELECT Name_1, ' ' AS CURDATE() FROM Table_1 ... or, better SELECT Name_1, ' ' AS CONCAT('My column ',...
4
by: Michael Hill | last post by:
I am having a problem formatting the third column. It should be 70px wide, but it is extending well beyond 70. The 2nd and 3rd column should be the same width. The content of the 3rd column...
2
by: Dman | last post by:
Having trouble in Access XP. I want to display the customers name, city and phone number in a Combo Box but the but the formatting is lost – eg (123) 456-7890 is displayed as 1234567890. Any...
3
by: McNutt Consulting | last post by:
I'm trying to implement a datagrid with dynamically created columns. The data is coming out of a very simple XML file, and it's bound through a dataview. The datagrid is just a shell definition...
5
by: cwbp17 | last post by:
Hi all, Have a datagrid that displays the price column of a table. Went to the Datagrid's Property builder and set the 'Data Formatting expression' for the PRICE column to {0:c}, so that the...
2
by: msnews | last post by:
Hi All, I have the following code ---------------------------------------------------- Business.Product pdt = new Business.Product(); SqlDataReader product = pdt.GetProductDeals(134); ...
1
by: Michael Calvin | last post by:
Some basic things I cannot figure out how to do with new datagrid. 1) How do I control the formatting of the column header separately from the rest of the column? 2) If I align right the...
1
by: benis.ong | last post by:
I have a gridview whose rowupdate, rowediting, rowcreated, rowcancelingedit commands are all written programmatically. Im trying to keep the columns in this grid view consistent by formatting the...
5
by: bob | last post by:
Now this ought to be a simple matter. But nothing's simple in the Net world, I'm finding. In vb6 you could use "!" to force text to upper case in the format function. I've searched the vb.net...
4
by: Keith G Hicks | last post by:
I have a gridview (asp.net 2.0) where I'm trying to format rows based on a NON VISIBLE column. It doesn't seem to work. When column 0 below is visible, the row is formatted as expected but when...
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,...
1
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...
0
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...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.