UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Problem With Condition <=now(), Access 2010    
 
   
edin14166
post Nov 2 2018, 04:58 AM
Post#1



Posts: 364
Joined: 15-November 05
From: BiH


Hello,
I have date function in a query =DateAdd("d",-10,[TblOsiguranje.DatumDo]) and
also want to put condition in criteria <=Now(), but it says that sintax is not correct,
what should I do?
Thanks in advance..
Go to the top of the page
 
Minty
post Nov 2 2018, 05:24 AM
Post#2



Posts: 123
Joined: 5-July 16



Although there appears to be nothing wrong with your criteria, can you cut a paste the exact code from your query window.
Also try simply <Now() as the equal is superfluous when comparing the date and time at the exact point you run the query.
Go to the top of the page
 
edin14166
post Nov 2 2018, 05:31 AM
Post#3



Posts: 364
Joined: 15-November 05
From: BiH



Hello Minty,
This is code,
Your suggestion does not work.

CODE
SELECT TblOsiguranje.id, lstMarkeVozila.NazivMarkeVozila & " " & TblRegOznake.RegOznaka AS Vozilo, TblOsiguranje.automobiliId, TblOsiguranje.DatumOsiguranja, TblOsiguranje.DatumOd, TblOsiguranje.DatumDo, TblOsiguranje.complete, =DateAdd("d",-10,[TblOsiguranje.DatumDo]) AS DatumReg
FROM ((lstMarkeVozila INNER JOIN TblAutomobili ON lstMarkeVozila.id = TblAutomobili.MarkaVozilaID) INNER JOIN (lstTipoviOsiguranja INNER JOIN TblOsiguranje ON lstTipoviOsiguranja.id = TblOsiguranje.tipoviOsiguranjaId) ON TblAutomobili.id = TblOsiguranje.automobiliId) INNER JOIN TblRegOznake ON TblAutomobili.id = TblRegOznake.AutomobiliID
WHERE (((TblOsiguranje.DatumDo)<=Now()) AND ((TblOsiguranje.complete)=False));
Go to the top of the page
 
Minty
post Nov 2 2018, 05:37 AM
Post#4



Posts: 123
Joined: 5-July 16



QUOTE
=DateAdd("d",-10,[TblOsiguranje.DatumDo]) AS DatumReg


This isn't correct - Access would strip out the = sign in the query designer, so this is impossible SQL unless you are creating it in a string.
Go to the top of the page
 
edin14166
post Nov 2 2018, 05:49 AM
Post#5



Posts: 364
Joined: 15-November 05
From: BiH


Thank You it works now...
Go to the top of the page
 
Minty
post Nov 2 2018, 05:55 AM
Post#6



Posts: 123
Joined: 5-July 16



Glad to help.

Good luck with your project!
Go to the top of the page
 
BruceM
post Nov 2 2018, 06:53 AM
Post#7


UtterAccess VIP
Posts: 7,724
Joined: 24-May 10
From: Downeast Maine


I believe the = sign was also addressed in another thread.
Go to the top of the page
 
Minty
post Nov 2 2018, 07:44 AM
Post#8



Posts: 123
Joined: 5-July 16



@Bruce - You are correct , I didn't see that one... dazed.gif
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    18th November 2018 - 05:46 AM