Thank you Billd I entered the function details as per your reply but I am
NOT sure about the bit to enter in the SQL query My SQL is as follows :-
SELECT [2-ProductSalesOrders].DateofSale, DatePart("yyyy",[Dateofsale]) AS
AccntYear, DatePart("M",[dateofSale]) AS AccntMonth, "Qrt " &
DatePart("q",[dateofsale]) AS DateprtQrt2
FROM [2-ProductSalesOrders]
WHERE (((DatePart("yyyy",[Dateofsale]))=2007));
The part "DatePart("M",[dateofSale]) AS AccntMonth" being the part I would
like to appear as Text can you please explain Granpa_rb
The DatePart function returns a month number. To display the month name use
the Format function instead:
SELECT [2-ProductSalesOrders].DateofSale, DatePart("yyyy",[Dateofsale]) AS
AccntYear, Format([dateofSale], "mmm") AS AccntMonth, "Qrt " &
DatePart("q",[dateofsale]) AS DateprtQrt2
FROM [2-ProductSalesOrders]
WHERE (((DatePart("yyyy",[Dateofsale]))=2007));
Or you could use a custom format to see the year, month and quarter all in one
string:
Format([dateofsale], "yyyy mmm \Q\r\t q")
will show 2007 Feb Qrt1.
Alternatively, just use a Form or Report to display your data (you shouldn't
be looking at query datasheets except for debugging); bind the DateOfSale
function to a textbox and set its Format property to "mmm".