I am Extraxting Data from Teradata using the two scripts below which are supposedly the same but Syntax 1) returns less than 2), i need to understand what could be causing the variance or if it's both the correct way to do it or not. please assist!
1. SELECT COUNT(1)
FROM
PROD_BI.BI_IT_TAXPAYER_H_KEY
WHERE DATE_START_HIST<= Cast(Current_date as Date) - (Extract (Day from Current_date))
AND DATE_END_HIST > Cast(Current_date as Date) - (Extract (Day from Current_date))
Results: 23 028 717
AND
2. SELECT COUNT(1)
FROM PROD_BI.BI_IT_TAXPAYER_H_KEY
WHERE DATE_START_HIST <='2013-06-30 00:00:00.000'
AND DATE_END_HIST > '2013-06-30 00:00:00.000'
Results: 23 028 732
Forums: