Solved

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

Posted on 2008-06-23
4
232 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 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

821 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