473,804 Members | 3,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combine 3 columns to make one Dated

1 New Member
I am trying to combine three columns (month, day, year) to make one date (month-day-year).

Here is the intital inforation when I hit the SQL button in Microsoft Query
UtilityMaster.m DateAutoInst1, UtilityMaster.d DateAutoInst1, UtilityMaster.y DateAutoInst1

Here is what I modified it to:
UtilityMaster.m DateAutoInst1+'-'+UtilityMaster .dDateAutoInst1 +'-'+UtilityMaster .yDateAutoInst1

When I hit OK, I get the following error: Incompatible types in expression.


Any suggestions?
Mar 15 '07 #1
1 2743
Atli
5,058 Recognized Expert Expert
Hi.

I am assuming, mainly because you post this in the MySQL forums that you are using MySQL?

If you want to combine strings in MySQL, you can use the CONCAT() function.
For example:
Expand|Select|Wrap|Line Numbers
  1. //Query (assumed that tbl has the given columns)
  2. SELECT CONCAT(month, '-', day, '-', year) FROM tbl
  3.  
  4. // Output (random data)
  5. 24-12-2006
  6.  
But, why dont you just use the DateTime type?
Or even just the Date type?
Mar 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
1986
by: DBLWizard | last post by:
Howdy, I need to compine two columns (LastName, Firstname) with the comma. The only problem I have is the Firstname could be blank and in that case I don't want the "," appended to the last name. This data is coming out of a Sql Server data base. I am currently using a DataReader and simply binding it to a data grid to display the information.
4
2224
by: Nehmo Sergheyev | last post by:
After reading about text line length http://psychology.wichita.edu/surl/usabilitynews/72/columns.htm , I'm thinking about experimenting with columns of text on a page. Is it possible on an HTML page to have 2 columns of text where the text of one column flows to the next on the visible part of the page, and scrolling treats the 2 columns like the bottom of the right column is connected to the top of the left column? Scrolling down...
1
3429
by: Lars E. | last post by:
Hi all. I am trying to combine data from 2 tables in one datagridview. I have tables: "Customer" and "CustomerContact". I want to display Customer information (displaying all fields in customer and some fields from customercontact) in a datagridview. I am not using sql so innerjoin is not possible.... The relation between the tables are: Customer.c-custno = CustomerContact.cc-custno.
3
1318
by: tshad | last post by:
I have about 10 functions that are identical except for one variable name that I am using in my "for" loop: for (ktr1=1;ktr1<=nhDataBean.projectCodeList.GetUpperBound(0);ktr1++) for (ktr1=1;ktr1<=nhDataBean.shiftCodeList.GetUpperBound(0);ktr1++) for (ktr1=1;ktr1<=nhDataBean.statusCodeList.GetUpperBound(0);ktr1++) How can I change the "nhDataBean.xxx.GetUpperBound(0)" so that I can use only one function?
1
2504
by: zwieback89 | last post by:
Hi, I am still not able to get this working in a simple page. Please help me. I am badly stuck.... I am trying to view the contents of the Beverage Category. I have built it like a hierarchy in the form of styled <UL> tags. Please assist me in combining the 2 pages into one page. I would extremely grateful. My code is:
2
5723
denny1824
by: denny1824 | last post by:
Hi everyone, Here is my problem. I have a Table Variable (I could easily turn it into a Temp Table instead) that will sometimes have rows that are identical except for one specific column. The column is of nvarchar. When the rest of the columns for those rows are identical, I want to combine all of the values of that column into a single nvarchar with a delimiter in between each value. Then combine the rows where all of the other columns are...
1
3419
by: bluereign | last post by:
Thank you for your assistance. I am a novice looking to JOIN and append or combine records from 2 current Tables into 2 new Tables named below. I have been able to JOIN Tables with the script below. My problem is if I don’t use the WHERE clause in my script below, the script can query up to 3 records with the same “LoanNo” due to the fact that there can be up to 3 “TypeCodes” in each Table (Borrower, Co-Borrower 1 and Co-Borrower 2...
8
3979
by: vineetbindal | last post by:
Hi All. I have two Columns column1 and column2. i have to run a query with some value from colum1 depending on it will select result from coloumn2 and if that result is present in coloumn 1 it will again select something from coloum2 again if that new result is present in coloum 1 it will select something from colum2 . i have to combine all this in one column without repeating values. something like. Column1 Column2 Column3 2100 ...
36
3849
by: stateemk | last post by:
I have a db with a table that has many columns of info for various entities. In this table, there are three columns called, entity name, second entity name and third entity name. I need to combine all three columns into one drop box so a search can be done. Once the correct entity name is found, I need to be able to select it and bring up a form with all the data for that entity. For example, say there is an entity that has a name change so...
0
9706
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
9579
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
10326
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
10317
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
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
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
6851
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
5520
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.