Quantcast
Channel: SQL Server Migration forum
Viewing all articles
Browse latest Browse all 1700

Datetime2 and Integer issue

$
0
0

Hi

In Access, with both FE and BE in Access, this query works:

The purpose of the query is to show records where [BF] ("BestBefore date") is < 100 (days)

SELECT [Grunddata Maltsorter].Namn, [BF]-Date() AS [Dagar kvar]
FROM [Grunddata Maltsorter] INNER JOIN [Inleverans insatsvaror rader Malt] ON [Grunddata Maltsorter].[Malt nr] = [Inleverans insatsvaror rader Malt].[Malt nr]
GROUP BY [Grunddata Maltsorter].Namn, [BF]-Date()
HAVING ((([BF]-Date())<100));

But after migrating to SQL server it generates an error pointing to Datetime2

I guess datetime2 is more complex than a simple integer as 100.

Whats the right syntax, working with SQL Server and also with an Access database?


Best // Peter Forss Stockholm and Sigtuna GMT &#43;1.00


Viewing all articles
Browse latest Browse all 1700

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>