473,659 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2656
Ma************@ wsip.com.pl (Marek Kotowski) wrote in message news:<e5******* *************** ****@posting.go ogle.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.go ogle.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**********@ho tmail.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**********@ho tmail.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.go ogle.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**********@ho tmail.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
3803
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 place the Labels and Entrys, but the Listbox is just in column 0, and I want it to take all the width (column 0 + column 1) here is the code: #########################
0
1045
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 ', CURDATE()) FROM Table_1 ... But it doesn't work. AS seems to take only single strings. Is there any solution?
1
1943
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 databases. Database server = DB2/LINUX 7.1.0
0
2646
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 CompanyName, ContactName, and ContactTitle columns from the Customers table in the Northwind database. Whenever the value of ContactTitle equals "Owner" we will change the font color to red. We can do this by using an ItemTemplate where we have...
2
2031
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 want to create a page that will display a title and date of each newsletter, along with a link to it. here's a code snip: ============================= DirectoryInfo dirInfo = new DirectoryInfo(Server.MapPath("/newsletters/xml/"));
2
3941
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 there's no support for this. Either that or I'm doing something wrong. Well, enough venting, here's what I need. Using this sample XML file (test.xml):
2
11977
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 tooltip for all the cells in the column. I'm doing the brute-force method right now of adding a tooltip to every <tdin the table. The problem there is that the HTML is ballooning in size as a result (see an example below). Any ideas,...
0
1021
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 a table (category, title and description) for matches in each column. Each column should now weigh differently (1. category, 2. title and 3. description) and I want the results to be ordered with hits in category on top, then title hits and last...
1
8897
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 "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
0
8428
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
8851
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
8630
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
6181
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
4176
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
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2759
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
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
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.