February 4th, 2004, 07:13 AM
CONVERT Date? How to display results?
I am trying to pull out the birthday dates from a table (MS SQL SERVER) so that the table that is displayed on the website only displays a list of birthdays.
My table contains the DOB column in datetime format.
I have used the following query in SQL Server Enterprise Manager:
SELECT CONVERT(varchar(10),DOB,103) FROM table1
and it works fine. It returns the date the way I want it - in SQL Server Enterprise Manager.
However, when I try to display it on the website, I am getting ZERO results. Nothing is displayed.
This is my code on the PHP site:
$query = "SELECT CONVERT(varchar(10),DOB,103) FROM table1";
How would I get the results from the query displayed in my table?
Or do I retrieve all DOBs first and then convert them once they are retrieved?
Thanks for your help,
February 4th, 2004, 07:55 AM
your query is fine
your problem seems to be php
you stand a better chance of getting an answer in the php forum
February 4th, 2004, 08:00 AM
cheers. will try that. thought it was a SQL thingy.