priyanka

priyanka

  • NA
  • 215
  • 123.2k

Fetch Record From DateTime Column in MsExcess

Sep 9 2017 2:44 AM
i have a datetime column containing this value
 
9/9/2017  11:12:29 AM
9/9/2017  11:12:54 AM
9/9/2017  11:14:05 AM
 
 
i am using this quey
 
SELECT Item_Code AS [Item Code], Prefix_Barrel AS [Prefix Barrel], Desc1 AS [New description1], Item_Ctg AS [Item Category], Item_Family AS [Item Family], Item_Type AS [Item Type], Item_Sub2 AS [Item SubType2], Mat_Cons AS [Material of Construction], '' AS [Material Grade], Lst_Process AS Process, Supply_Type AS [Supply Type], Remarks, Format(Created_DateTime,'yyyy-mm-dd') AS [Created DateTime]
FROM ITEM_CD_CREATION WHERE Created_DateTime Between #2017-09-09# And #2017-09-10# ORDER BY Item_Code;
 
i have tried this
 
 SELECT Item_Code AS [Item Code], Prefix_Barrel AS [Prefix Barrel], Desc1 AS [New description1], Item_Ctg AS [Item Category], Item_Family AS [Item Family], Item_Type AS [Item Type], Item_Sub2 AS [Item SubType2], Mat_Cons AS [Material of Construction], '' AS [Material Grade], Lst_Process AS Process, Supply_Type AS [Supply Type], Remarks, Format(Created_DateTime,'yyyy-mm-dd') AS [Created DateTime]
FROM ITEM_CD_CREATION WHERE WHERE Format(Created_DateTime,'yyyy-mm-dd')
Between #2017-09-09# And #2017-09-10# ORDER BY Item_Code;
 
but fails to retrieve record.
 
Plz  suggest me what i am doing wrong.

Answers (1)