SimpleDT_Function.txtJuly 26, 2001 Here's a UDF function for SQL 2000 that will save you datetime headaches when passing datetime variables into your SQL Procedures. The function converts any datetime field to ensure that you don't lose data for the last day to be included. Some SQL Procedures use 'between' when quering datetime fields. This may cause you to lose data on the last day:
Example:
A solution is to rewrite the SQL to 'Select * from table where transaction_date >= '20010709' and transaction_date
This function converts any datetime field to this format for your queries that use datetime datatypes.
Author: Anthony Loera
Download Script:
Disclaimer: We hope that the information on these script pages is
valuable to you. Your use of the information contained in these pages,
however, is at your sole risk. All information on these pages is provided
"as -is", without any warranty, whether express or implied, of its accuracy,
completeness, or fitness for a particular purpose...
Disclaimer Continued
Back to Database Journal Home
|