Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi again, Thanks people for your

Status
Not open for further replies.

a0000

Programmer
Mar 17, 2000
9
GB
Hi again,

Thanks people for your advice on ISBN numbers which I needed for a library program
I'm doing.

I really would appreciate help on another problem that I posted months ago but
which I still cannot solve. I am having difficulties with dates in an sql statement
called in a vba module. I get this message:

"Function isn't available in expressions in query expression:
(&quot;SELECT New_Ref FROM dummy WHERE (((dummy.state)='granted / renewal') AND (([Renewal_Date]-Date()) <21));&quot;)

I've tried using DateDiff but i get the same message. I'm convinced the problem is
to do with my environment. I have tried changing 'short date' in regional settings to the
USA style dates but to no avail.

Someone must have encountered similar problems with date functions. Can anyone
please help

thanks very much in advance and thank for previous help

mak [sig][/sig]
 
Sorry .

I forgot to mention that I use Access 97 and am on an NT platform

thanks [sig][/sig]
 
Hi,
If DateDiff(&quot;d&quot;, Date1, Date2) doesn't work within the embedded SQL statement, maybe try extracting the renewal date prior to the SQL statement, then do something like this:

....get value into recordset named MyRecordSet....

(&quot;SELECT New_Ref FROM dummy WHERE (((dummy.state)='granted / renewal') AND ((&quot; & DateDiff(&quot;d&quot;, MyRecordSet![Renewal_Date], Date()) & &quot; <21))&quot;)

I don't think that you can just subtract dates like Date1-Date2. [sig]<p>Rob Marriott<br><a href=mailto:rob@career-connections.net>rob@career-connections.net</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top