473,385 Members | 1,907 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 to parametrize additional column title?

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 ', CURDATE()) FROM Table_1 ...

But it doesn't work. AS seems to take only single strings.
Is there any solution?

Thanks in advance.

Marek Kotowski
Warsaw
Jul 19 '05 #1
6 2644
Ma************@wsip.com.pl (Marek Kotowski) wrote in message news:<e5**************************@posting.google. com>...
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 ', CURDATE()) FROM Table_1 ...

But it doesn't work. AS seems to take only single strings.
Is there any solution?

Thanks in advance.

Marek Kotowski
Warsaw


Try (notice the 'AS' keyword is for making an alternative column name):
SELECT Name_1 AS Alternate_name, NOW() FROM Table_1;

or for formatting:

SELECT Name_1, DATE_FORMAT(NOW(),'%W, %M %D %Y') AS 'Formated date' FROM Table_1;

Read for formatting date:
http://www.mysql.com/doc/en/Date_and...functions.html
Jul 19 '05 #2
Ma************@wsip.com.pl (Marek Kotowski) wrote in message news:<e5**************************@posting.google. com>...
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 ', CURDATE()) FROM Table_1 ...

But it doesn't work. AS seems to take only single strings.
Is there any solution?

Thanks in advance.

Marek Kotowski
Warsaw


Try (notice the 'AS' keyword is for making an alternative column name):
SELECT Name_1 AS Alternate_name, NOW() FROM Table_1;

or for formatting:

SELECT Name_1, DATE_FORMAT(NOW(),'%W, %M %D %Y') AS 'Formated date' FROM Table_1;

Read for formatting date:
http://www.mysql.com/doc/en/Date_and...functions.html
Jul 19 '05 #3
ed**********@hotmail.com (Nejoom) wrote in message
[...]
or for formatting:

SELECT Name_1, DATE_FORMAT(NOW(),'%W, %M %D %Y') AS 'Formated date' FROM Table_1;


Thank you very much. The problem is I need an empty column
(to be printed and filled later), with a title with a current
date.

MK
Jul 19 '05 #4
ed**********@hotmail.com (Nejoom) wrote in message
[...]
or for formatting:

SELECT Name_1, DATE_FORMAT(NOW(),'%W, %M %D %Y') AS 'Formated date' FROM Table_1;


Thank you very much. The problem is I need an empty column
(to be printed and filled later), with a title with a current
date.

MK
Jul 19 '05 #5
Ma************@wsip.com.pl (Marek Kotowski) wrote in message news:<e5**************************@posting.google. com>...
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 ', CURDATE()) FROM Table_1 ...

But it doesn't work. AS seems to take only single strings.
Is there any solution?

Thanks in advance.

Marek Kotowski
Warsaw


Try (notice the 'AS' keyword is for making an alternative column name):
SELECT Name_1 AS Alternate_name, NOW() FROM Table_1;

or for formatting:

SELECT Name_1, DATE_FORMAT(NOW(),'%W, %M %D %Y') AS 'Formated date' FROM Table_1;

Read for formatting date:
http://www.mysql.com/doc/en/Date_and...functions.html
Jul 19 '05 #6
ed**********@hotmail.com (Nejoom) wrote in message
[...]
or for formatting:

SELECT Name_1, DATE_FORMAT(NOW(),'%W, %M %D %Y') AS 'Formated date' FROM Table_1;


Thank you very much. The problem is I need an empty column
(to be printed and filled later), with a title with a current
date.

MK
Jul 19 '05 #7

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

Similar topics

2
by: Nicolas Favre-Félix | last post by:
Hello, I have a little problem using Tkinter: I'd like to make a interface with 3 labels on the left, facing with 3 Entry on the right, a button below Entrys, and a Listbox under all. I could...
0
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 ',...
1
by: Terry | last post by:
Problem: ========= Unknown column appearing in federated tables. Description: ============ Local database (L) is an established 'federated' database, extracting values from multiple remote...
0
by: Amber | last post by:
There are times when you will need to highlight or otherwise modify the contents of a particular DataGrid row-column value based upon the value in the column. In this example we will select the...
2
by: dSchwartz | last post by:
I need help adding a column to a dataset, but its a little bit more complicated then just that. Here's the situation: I have many xml files in one directory, each which represent a newsletter. I...
2
by: ricky | last post by:
Hello, If anyone could help me with this I would highly appreciate it. I've tried everything and nothing works. What I am trying to do is so damn basic and it's just frustrating that it seems...
2
by: Frank | last post by:
I could use your help. I need to add tooltips to each column of an HTML table, for the entire column of cells. I want to add a single element to the table, and have that one element represent the...
0
by: Chran | last post by:
Hi everybody, I am working on a search function for an e-commerce site and I just cant figure this one out. It is probably not that hard but I am stuck. The search is searching three columns in...
1
Death Slaught
by: Death Slaught | last post by:
I will be showing you how to make a very simple but effective three column layout. First we will begin with the HTML, or structure, of our three column layout. <!DOCTYPE html PUBLIC...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.