Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting of DateTime... 1

Status
Not open for further replies.

Neil Toulouse

Programmer
Mar 18, 2002
882
GB
Hi folks!

I am hoping this is an easy one but has me stumped for some reason!

I have a query against a SQL Server table that returns (amongst other things) a DATETIME value. The results are then displayed in a grid.

I only want to display the date element of this DATETIME field, but don't want to do this by altering the query (unless I really have to - for reasons I won't bore you with!!).

Is there a format/inputmask setting I can use to do this?

TIA
Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
Neil,
What you use to get data from SQL Server?
If you use RV you could map DateTime field to Date one in View Designer.
If you use CursorAdapter you could use CursorSchema property to map DateTime to Date field.
If you use SPT cursor you should run a new query against the result cursor to have a date field:
Code:
SELECT ....., TTOD(MyDateTimeField) AS DateField.....
       FROM SPTCursor
and bind the grid to that cursor.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
Cheers Olaf! Exactly what is needed :)

I like work. It fascinates me. I can sit and look at it for hours...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top