Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need help with Calculated Access SQL syntax for selecting data within a certain period

Posted on 2008-06-23
4
Medium Priority
?
238 Views
Last Modified: 2013-11-27
STATUS:IIF([The_Date]<= GetDate() AND IsNull([STATUS]),"Write",[STATUS])

I have a vba module with function,


or if I could get it to work just by using SQL

Function GetDate()
   dim a 
    a = weekday(now(),vbmonday)
    a = int(now())-a
    a = GetDate
End Function

Open in new window

0
Comment
Question by:7601105166084
  • 2
  • 2
4 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21844890
your function's last line is wrong:
Function GetDate()
   dim a 
    a = weekday(now(),vbmonday)
    a = int(now())-a
    GetDate = a
End Function

Open in new window

0
 

Author Comment

by:7601105166084
ID: 21845039
Sorry you are right i re-wrote the function incorrectly [only here ((-:]  but is there anything else which seems wrong.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 21845296
you might set the data type to date:
Function GetDate() as Date
   dim a 
    a = weekday(now(),vbmonday)
    a = int(now())-a
    GetDate = a
End Function

Open in new window

0
 

Author Closing Comment

by:7601105166084
ID: 31469676
Thanks - i think i was using the field name too instead of an alias.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question