In a message dated 98-11-04 10:23:38 EST, you write:
I’m using BO version 4.1.3 on Sybase 11 and would like to try and emulate
the Quarter functionality from the Evaluation kit example. ie ‘Q’
Format(Sales.invoice_date,‘Q’)
Is this possible in some way ?!
Ta
Mike in SA
Mike:
You should be able to use the datepart() function to return the date formated as a quarter in Sybase. Below is information taken from a help file for an earlier version of Sybase; your version should have something very similar. I included the help file notes because there are so many options for the function parameters.
Note that the datepart() function returns a number; to concatenate the ‘Q’ on the front would require you to convert the number to a string.
datepart (date_part, date_value)
produces the specified date part (the first argument) of the specified date (the second argument) as an integer. Takes either a datetime or smalldatetime value as its second argument.
It is also used as an argument with dateadd, datediff, datename, and datepart. The following table lists the date parts, the abbreviations recognized by SQL Server, and the acceptable values.
Date Part Abbreviation Values
year yy 1753 - 9999 (2079 for smalldatetime)
quarter qq 1 - 4
month mm 1 - 12
dayofyear dy 1 - 366
day dd 1 - 31
week wk 1 - 54
weekday dw 1 - 7 (Sun.-Sat.)
hour hh 0 - 23
minute mi 0 - 59
second ss 0 - 59
millisecond ms 0 - 999