How i should write this sql query, than its work on access also.
I like to have all customers who have started 20 years ago from this year
VB Code:
sSQL="select customername,startdate from customers where DATEDIFF(year, startdate, getdate())>19"
Printable View
How i should write this sql query, than its work on access also.
I like to have all customers who have started 20 years ago from this year
VB Code:
sSQL="select customername,startdate from customers where DATEDIFF(year, startdate, getdate())>19"
getdate = now 'in access
check the DATABASE_NAME and form a query...:)
Thanks VeryjonnyQuote:
Originally posted by veryjonny
getdate = now 'in access
check the DATABASE_NAME and form a query...:)
I solved it thisway
VB Code:
sSQL="select customername,startdate from customers where DATEDIFF("yyyy",startdate, now)>19"
I use 95% SQLServer and my memory getting shorter with differences between SQLServer and Access :)