sql limit date time only jan my sql

SELECT `sellhead`.TrnDate, `sellhead`.InvoiceNo, `sellhead`.CName, `sellhead`.
       VatAmt, `sellhead`.NetAmt
  FROM AOL.sellhead `sellhead`
 WHERE (`sellhead`.InvoiceNo LIKE '00%')

How can  I select only TrnDate that only in Jan     the for mat   TrnDate is  datetime
CREATE TABLE `sellhead` (
  `Branch` varchar(3) NOT NULL DEFAULT '0',
  `Code` double NOT NULL DEFAULT '0',
  `TrnDate` datetime DEFAULT NULL,
  `TType` char(1) NOT NULL DEFAULT 'A',
  `AccTp` ENUM('R','C','Q','D') NOT NULL DEFAULT 'R',
  `DocType` ENUM('I','D') NOT NULL DEFAULT 'D',
  `InvoiceNo` varchar(10) DEFAULT NULL,
  `DocNo` varchar(10) DEFAULT NULL,
  `InvoiceDate` datetime DEFAULT NULL,
  `BackNo` varchar(10) DEFAULT NULL,
  `Reference` varchar(15) DEFAULT NULL,
  `cid` double NOT NULL DEFAULT '0',
  `CName` varchar(100) DEFAULT NULL,
  `Adr1` varchar(40) DEFAULT NULL,
  `Adr2` varchar(40) DEFAULT NULL,
  `Address` text,
  `Zip` varchar(5) DEFAULT NULL,
  `DueDate` date NOT NULL DEFAULT '0000-00-00',
  `SCode` varchar(6) DEFAULT NULL,
  `Amount` double NOT NULL DEFAULT '0',
  `SpDiscount` double NOT NULL DEFAULT '0',
  `TotAmt` double NOT NULL DEFAULT '0',
  `TaxType` ENUM('E','I','N') NOT NULL DEFAULT 'E',
  `Vat` double NOT NULL DEFAULT '0',
  `VatAmt` double NOT NULL DEFAULT '0',
  `NetAmt` double NOT NULL DEFAULT '0',
  `RcvAmt` double DEFAULT NULL,
  `RealRcvAmt` double NOT NULL DEFAULT '0',
  `Remark` varchar(50) DEFAULT NULL,
  `BankCode` varchar(4) DEFAULT NULL,
  `ChqNo` varchar(15) DEFAULT NULL,
  `ChqDate` date DEFAULT NULL,
  `CreditCard` varchar(4) DEFAULT NULL,
  `CardNo` varchar(16) DEFAULT NULL,
  `CardExp` varchar(5) DEFAULT '  /',
  `Status` char(1) DEFAULT NULL,
  `ToAR` ENUM('Y','N') NOT NULL DEFAULT 'N',
  `UID` varchar(10) DEFAULT NULL,
  `UDT` datetime DEFAULT NULL,
  `PayDate` datetime DEFAULT NULL,
  `cancel_b` ENUM('Y','N') NOT NULL DEFAULT 'N',
  `canStaff` varchar(12) DEFAULT NULL,
  `canDate` datetime DEFAULT NULL,
  `CommCutOff` char(1) NOT NULL DEFAULT 'N',
  PRIMARY KEY  (`Code`),
  KEY `cancel_b` (`cancel_b`),
  KEY `UDT` (`UDT`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Transaction Header';

Open in new window

teeraAsked:
Who is Participating?
 
ee_rleeConnect With a Mentor Commented:
hi, try this

where (Month(TrnDate) = 1 AND Year(TrnDate)=2008)
0
 
bobbit31Commented:
Hello winklez,

where Month(TrnDate) = 1

Regards,

bobbit31
0
 
teeraAuthor Commented:
Thank you very much :bobbit31

But it collect  jan of 2004 to jan 2008   I want only  Jan 2008 How can I do that
0
All Courses

From novice to tech pro — start learning today.