Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL datetime --> VFP date in a query
Message
From
11/03/2002 11:59:00
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00630844
Message ID:
00631044
Views:
24
Hi,
We have had a similar problem and have created a SQL Server User Written Function that we refer to as a sql FUNCTION whenever the date only is required:

CREATE FUNCTION dbo.xfn__DateOnly (@vcDateTime datetime)
RETURNS VarChar(10)
WITH SCHEMABINDING
AS
BEGIN
RETURN CONVERT(VarChar(12), @vcDateTime, 101)
END
-----------
The above code creates the function in the local Database User Defined Function area as XFN__DateOnly (with source code). We then move the compiled function into the Master UDF as fn__DateOnly (without sourcecode).

Then in a SQL Stored Procedure
SELECT vcTransNoIN, dtIssuedIN = FN__DATEONLY(dtIssuedIN), etc.....

I hope this helps?
Previous
Reply
Map
View

Click here to load this message in the networking platform