|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Howdy.
Am somewhat new to mySQL 5...in conjunction with phpTimeClock (open source app) on a winXP sp2 box. Trying to convert a column named timestamp (bingint(14)) so that it displays the date in year month day using date_format(timestamp, '%Y%m %e') with statement: select date_format('timestamp', '%Y%m%e'),note from info where fullname like 'martina%'; And I get: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout as test, `inout` from info' at line 1 An example of the data in the timestamp column is 1172008033. In addition, when attempting to add the column inout (varchar (50)) as in select notes, inout from info; I get the same err whose err number is 1064. Appreciate if someone could direct me to the correct syntax... Thanks, Rey |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
>Am somewhat new to mySQL 5...in conjunction with phpTimeClock (open
>source app) on a winXP sp2 box. > >Trying to convert a column named timestamp (bingint(14)) so that it >displays the date in year month day using date_format(timestamp, '%Y%m >%e') with statement: > >select date_format('timestamp', '%Y%m%e'),note from info where >fullname like 'martina%'; 'timestamp' is a fixed string containing 9 alphabetic characters. `timestamp` is a column name. timestamp is a keyword and it can't be used as a column name unless you backquote (``) it. >And I get: >You have an error in your SQL syntax; check the manual that >corresponds to your MySQL server version for the right syntax to use >near 'inout as test, `inout` from info' at line 1 I see absolutely nothing in the above query that says "inout as test". >An example of the data in the timestamp column is 1172008033. >In addition, when attempting to add the column inout (varchar (50)) as >in >select notes, inout from info; > >I get the same err whose err number is 1064. > >Appreciate if someone could direct me to the correct syntax... |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Sep 28, 4:55 pm, gordonb.5j...@burditt.org (Gordon Burditt) wrote:
> >Am somewhat new to mySQL 5...in conjunction with phpTimeClock (open > >source app) on a winXP sp2 box. > > >Trying to convert a column named timestamp (bingint(14)) so that it > >displays the date in year month day using date_format(timestamp, '%Y%m > >%e') with statement: > > >select date_format('timestamp', '%Y%m%e'),note from info where > >fullname like 'martina%'; > > 'timestamp' is a fixed string containing 9 alphabetic characters. > `timestamp` is a column name. > timestamp is a keyword and it can't be used as a column name unless you > backquote (``) it. > > >And I get: > >You have an error in your SQL syntax; check the manual that > >corresponds to your MySQL server version for the right syntax to use > >near 'inout as test, `inout` from info' at line 1 > > I see absolutely nothing in the above query that says "inout as test". > > >An example of the data in the timestamp column is 1172008033. > >In addition, when attempting to add the column inout (varchar (50)) as > >in > >select notes, inout from info; > > >I get the same err whose err number is 1064. > > >Appreciate if someone could direct me to the correct syntax... Howdy Gordon. Thanks for replying and info on timestamp column. I also backquoted the inout column as I had forgotten to mention that both the mySQL query browser and HeidiSQL where showing inout in same syntax colors as select... So now with this statement I get the timestamp values (1184100363) and the inout values (out, in, in for lunch): select `timestamp`,date_format(`timestamp`, '%c%d%Y') as theDate, `inout` from info where fullname like 'martina%'; However, in date_format conversion returns null for all values in that column. As the 'timestamp' column is a BigInt then will have to figue out how to convert this to a date, etc. Now to check back at SorgeForge site for info, in any, on it conversion. Thanks, Rey |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On 1 Oct, 16:35, Rey <reycoll...@cox.net> wrote:
> On Sep 28, 4:55 pm, gordonb.5j...@burditt.org (Gordon Burditt) wrote: > > > > > > > >Am somewhat new to mySQL 5...in conjunction with phpTimeClock (open > > >source app) on a winXP sp2 box. > > > >Trying to convert a column named timestamp (bingint(14)) so that it > > >displays the date in year month day using date_format(timestamp, '%Y%m > > >%e') with statement: > > > >select date_format('timestamp', '%Y%m%e'),note from info where > > >fullname like 'martina%'; > > > 'timestamp' is a fixed string containing 9 alphabetic characters. > > `timestamp` is a column name. > > timestamp is a keyword and it can't be used as a column name unless you > > backquote (``) it. > > > >And I get: > > >You have an error in your SQL syntax; check the manual that > > >corresponds to your MySQL server version for the right syntax to use > > >near 'inout as test, `inout` from info' at line 1 > > > I see absolutely nothing in the above query that says "inout as test". > > > >An example of the data in the timestamp column is 1172008033. > > >In addition, when attempting to add the column inout (varchar (50)) as > > >in > > >select notes, inout from info; > > > >I get the same err whose err number is 1064. > > > >Appreciate if someone could direct me to the correct syntax... > > Howdy Gordon. > Thanks for replying and info on timestamp column. > > I also backquoted the inout column as I had forgotten to mention that > both the mySQL query browser and HeidiSQL where showing inout in same > syntax colors as select... > > So now with this statement I get the timestamp values (1184100363) and > the inout values (out, in, in for lunch): > select `timestamp`,date_format(`timestamp`, '%c%d%Y') as theDate, > `inout` from info where fullname like 'martina%'; > > However, in date_format conversion returns null for all values in that > column. As the 'timestamp' column is a BigInt then will have to figue > out how to convert this to a date, etc. Now to check back at > SorgeForge site for info, in any, on it conversion. > > Thanks, > Rey- Hide quoted text - > > - Show quoted text - Why not make your timesamp column a timestamp type? |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
>
> Why not make your timesamp column a timestamp type?- Hide quoted text - > Howdy, Captain Paralytic. Interesting name... Added timestamp column as punchDate. Get errors when attempting to cast `timestamp` column as datetime or timestamp, e.g. truncated datetime value. Will have to search source code - possibly reports - to see what is used to convert the `timestamp` column to readable date... Thanks, Rey |
|
![]() |
| Outils de la discussion | |
|
|