Freek's Blog

SQL en .NET vraagstukken en oplossingen die ik zoal tegenkom
posts - 199, comments - 123, trackbacks - 2, articles - 7

My Links

News

Google analytics script: Locations of visitors to this page

Article Categories

Archives

Post Categories

Image Galleries

Algemene links

MSDN

vb links

t-sql: how tu use the 'current date' in a MSDASQL query

Posted on Thursday, July 01, 2010 11:00 AM

I have a queries which retrieves invoices from a table.
But the getdate() is not an option in this case, because I use a ODBC driver.

When I use the below function there is no problem.

select {fn NOW()}

But this shows also the time.
By using

SELECT {fn curdate()}

I was able to avoid the time part.

My query looked like this

 

Select top 10 * from openquery(Transoft, '
select * from table
WHERE processDate = {fn curdate()}'
)

Transsoft =  ODBC driver to connect to tables I us.

 

 

 

Post Comment

Title  
Name  
Url
Comment   

ATTENTION: the code you need to copy is CaSe SeNsItIvE and is required to prevent spam.
Enter the code you see: