I am really stuck on getting date only from a mssql_query.
I am running PHP on Linux with MySQL and need to compare a birthdate stored as a string in MySQL to a birthdate stored on MSSQL as datetime . . .
My Query:
$sql="select UDEF_3A_2, SSN, ID_NUM, BIRTH_DTE from BIOGRAPH_MASTER where SSN = $ssn";
It returns BIRTH_DTE as:
Apr 1 1987 12:00:00:000AM OR AS
Apr 1 1987 12:00:00:000AM
I need to convert that to a string: 04-01-1987 and I can either make it work when the date has a two digit day, or a one digit day, but not both . . .
** Part of my problem is that sometimes the date from the SQL server comes back with a space in front of the single digit for day, and sometimes there is no space in front of a single digit day.
I have spent considerable time on this and would really appreciate any help possible. I am stuck!