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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 todays date -- mysql

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2006-12-14 : 07:32:38
I want to query as follows (this is for mysql not mssql):

select top 1 * from tableb where date=now()

I think my sytax is wrong but date is a datetime field and I want to select records that match todays date -- how do I do this?

also what syntax should i use when i insert into tableb(date)values (datefield)

please advise -- i only want to look at date and now time.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-14 : 07:36:43
[code]where datecol = CURDATE()[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-14 : 09:06:32
<<
I want to query as follows (this is for mysql not mssql):
>>

1 You know that this is SQL Server Forum
2 You should post at www.DBForums.com or www.MYSQL.com


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -