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 |
|
PrequelToTheSQL
Starting Member
2 Posts |
Posted - 2012-05-06 : 22:24:11
|
| im writing a query that calculates how many minutes it took for the first person to register to a websitethe start time at 2012-3-13 17:22:00 and registration times are in a tablei think im using timediff function like this:select timediff(minute, 2012-3-13 17:22:00, reg.registrationDateTime)from regorder by registrationDateTimelimit 1;but this is not working... what am i doing wrong? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-06 : 22:50:55
|
| are you using sql server? limit and timediff are not t-sql functions. you should be using top and datediff instead------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
PrequelToTheSQL
Starting Member
2 Posts |
Posted - 2012-05-06 : 23:07:33
|
| well my teacher told me to use timediff function for mysqlregardless, even using datediff and top returns the same exact syntax error:Records: in 0.0003 sec Error: 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 '17:22:00, reg.registrationDateTime) from reg order by registrationDateTi' at line 1 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-06 : 23:11:48
|
quote: Originally posted by PrequelToTheSQL well my teacher told me to use timediff function for mysqlregardless, even using datediff and top returns the same exact syntax error:Records: in 0.0003 sec Error: 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 '17:22:00, reg.registrationDateTime) from reg order by registrationDateTi' at line 1
As expected you're using mysql which is another dbms This is ms sql server forum and people here are mostly familiar with only t-sql. So please post in some mysql forums for getting mysql related help------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|