I read the earlier post to see if someone had address this topic. I have a column with the following data:
birth_date 4/23/1945 8/20/1962 3/27/1962 2/11/1958 3/21/1951 11/18/1951 8/15/1983 2/22/1971 1/24/1931 11/14/1944 12/15/1949 10/15/1965 9/25/1967 I need to read this and produce the following information:
day_born/age Monday / 41.7 Wednsday/ 58.2 Saturday/ 78.4 Tuesday / 51.3 Sunday / 57.6 Thursday/ 59.5 Monday / 64.1 Friday / 43.6 Tuesday / 64.6 I placed the forward slash in the represent the space between the data and column. But I need to calculate the date and extract the day of the week and the years
SELECT person_name, birth_city, dayname(birth_date) as day_born, truncate(datediff(current_date,birth_date)/ 365,1) as age, operations FROM `john` ORDER by person_name
The query is hanging on the dayname function. Is there a better way to do this? I reviewed the Microsoft SQL server transact-SQL and utilities reference, Vol 2. I am just missing a simple syntax issue. The error states dayname not a recognize function. I change to Day and get the same thing.