Displaying 1 result from an estimated 1 matches for "account_opening_d".
2012 Feb 15
1
Passing date as parameter while retrieving data from database using dbGetQuery
..."))
start_dt <- as.Date('2010-11-01',format="%Y-%m-%d")
end_dt <- as.Date('2011-01-31',format="%Y-%m-%d")
library(sqldf)
target_population <- dbGetQuery(conn,
"select distinct
a.primary_customer_code as cust_id,
a.primary_product_code,
a.account_opening_date,
b.l4_product_hierarchy_code,
b.l5_product_hierarchy_code
from account_dim a,
product_dim b
where a.primary_product_code=b.l5_product_hierarchy_code
and a.account_opening_date between start_dt and end_dt")
####################################################################
As it is not p...