| Author |
Topic |
|
kiesh
Starting Member
6 Posts |
Posted - 2009-11-13 : 00:20:05
|
Here my situation:-i have a table which includes a date column that is formatted as dd/mm/yyyy, no time is used.-Users usually create whatever it is via a form, and select a date, in the format mentioned, this info is then added to table in the database.-What i want is to display only the records of the current date on my pc, i say this, because i want to be able to change my pc date and it pulls only those records of that date, hence current date.-I thought it would be as simple as using some like this:select * from tablename where datecolumn=getdate() but i keep getting this error:ERROR 1305 (42000): FUNCTION dbname.getdate does not existA solution would be greatly appreciated, and preferably with an example.Thank you! |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-11-13 : 00:32:12
|
| r u using mssql or oracle?if ur using oracle use sysdate function |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-11-13 : 01:00:46
|
MySQL ? FYI this is a Microsoft SQL Server forum KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
kiesh
Starting Member
6 Posts |
Posted - 2009-11-13 : 01:36:57
|
| i am using mysql |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-11-13 : 01:53:45
|
| i think u have to use now() function........... in mysql |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-11-13 : 02:12:33
|
| Excatly in mysqlselect * from table_name where date(column_name) =date(now())Better use http://forums.mysql.com/Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-13 : 02:12:55
|
quote: Originally posted by kiesh i am using mysql
select * from tablename where datecolumn>=current_date() and datecolumn<adddate(current_date() ,interval 1 day)MadhivananFailing to plan is Planning to fail |
 |
|
|
kiesh
Starting Member
6 Posts |
Posted - 2009-11-14 : 12:22:39
|
| Thsk alot guys for you help. got it to work! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-16 : 01:35:14
|
quote: Originally posted by kiesh Thsk alot guys for you help. got it to work!
But keep in mind that this site is specifically form MS SQL Server and not mysql.MadhivananFailing to plan is Planning to fail |
 |
|
|
|