User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 423,654 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,095 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 2573 | Replies: 1
Reply
Join Date: Jul 2004
Posts: 8
Reputation: AwSDesigns is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
AwSDesigns AwSDesigns is offline Offline
Newbie Poster

Help MySQL, SQL conglutinate date items

  #1  
Oct 21st, 2004
HI all
(Battled with the WORD – (probably wrong in these terms))
I have a field in an access database (DateInserted) and want to get a (DateID) field out of it.
To get the DateID field I use – Day(DateInserted)&Month(DateInserted)&Year(DateInserted) - (Unique key for date outputs as 21102004) my problem is that the & function does not work in MySQL.
The job I am busy with at the moment requires that I have this (newspaper’s website http://www.zoutnet.co.za news articles on a weekly basis – DATE IMPORTANT)
Question: how can I turn Day(DateInserted)&Month(DateInserted)&Year(DateInserted) as DateID into MySQL savy SQL
ANYONE THAT CAN HELP PLEASE, PLEASE DO SO!!!!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2004
Posts: 8
Reputation: AwSDesigns is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
AwSDesigns AwSDesigns is offline Offline
Newbie Poster

Re: MySQL, SQL conglutinate date items

  #2  
Nov 23rd, 2004
Got the answer!!!!


SELECT REPLACE(MAKE_SET(7,LPAD(Dayofmonth(Date),2,'0'),LPAD(month(Date),2,'0'),Year(Date)),',','')AS DateID From dateTable


it is a bit of a wired way but it works!
OUTPUT = 231104
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 10:51 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC