FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


SQL Syntax related to Date [NOW()]





pashmina
Can somebody rewrite this SQL syntax

this syntax should simply fetch the value of today's date
Code:
SELECT
  *
FROM `currencyrate`
 INNER JOIN currency ON (currencyrate.currencyid=currency.currencyid)
 
 WHERE
  (
    (date = 'NOW()')
  );



edit
and BTW this is the structure
Code:
-- Table: currencyrate

-- DROP TABLE IF EXISTS `currencyrate`;

CREATE TABLE `currencyrate` (
  `currencyrateid`  int AUTO_INCREMENT NOT NULL,
  `date`            date NOT NULL,
  `dateid`          int,
  `currencyid`      int NOT NULL,
  `unit`            int,
  `buying`          decimal(10,2),
  `selling`         decimal(10,2),
  /* Keys */
  PRIMARY KEY (`currencyrateid`)
) ENGINE = MyISAM;

------------------------------------------

-- Table: currency

-- DROP TABLE IF EXISTS `currency`;

CREATE TABLE `currency` (
  `currencyid`    int AUTO_INCREMENT NOT NULL,
  `currencycode`  varchar(3) NOT NULL,
  `currencyname`  varchar(50) NOT NULL,
  /* Keys */
  PRIMARY KEY (`currencyid`)
) ENGINE = MyISAM;

CREATE UNIQUE INDEX `currencycode`
  ON `currency`
  (`currencycode`);

kv
Code:

select now();


Easy Smile
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.