Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Front-Line
Starting Member
4 Posts |
Posted - 2009-10-28 : 11:00:07
|
| Hello to all, i'm currently importing an mdb file into excel using MS Query, in this table, I got about 5 columns which 2 of them are:Hour, MinuteThe data under Hour are, 8,8,9,9,10,10..and under Minute, it's 0,30,0,30,0..so in excel it looks like8 08 309 09 30what I want to do is, create 1 column that will have these 2 columns combined together in Ms Query.How should that be done ?Thanks to all, |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-10-28 : 11:42:44
|
| select hour + ' ' + minute from... |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-10-28 : 11:46:30
|
| so that you get 08:00,08:30, etc.? select convert(char(5),dateadd(mi,[minute],dateadd(hour,[hour],0)),108)You should store these as DATETIME data type.JimEveryday I learn something that somebody else already knew |
 |
|
|
Front-Line
Starting Member
4 Posts |
Posted - 2009-10-28 : 12:03:08
|
| I tried to add the code but I got an error message.I'm kinda new to this... Here's the code that I currently have:SELECT DISTINCT IDP.Name, LastName, Date, Hour, Minute, Data1, Data2FROM `\\filexta\data\`.IDP IDPWHERE (IDP.Date=?)Could you tell me what should be the entire code ?Thanks, |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-10-28 : 12:04:33
|
First you should post that error message. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Front-Line
Starting Member
4 Posts |
Posted - 2009-10-28 : 13:06:40
|
| it said that my query is not runnning in graph mode |
 |
|
|
|
|
|
|
|