Avatar of shieldsco
shieldsco
Flag for United States of America asked on

Access 2013 Calculated Date Columns in Table

I have an access table that I'm trying to append to a SharePoint list. The SP list has two calculated columns:
 CurrentMonth: IIf(Str([Today])=Str([Due Date]),1,0)
 PastDue:IIf([Today]>[Due Date],1,0)

 What is the correct expression for my Access calculated columns?
Microsoft SharePointMicrosoft Access

Avatar of undefined
Last Comment
Rey Obrero (Capricorn1)

8/22/2022 - Mon
Rey Obrero (Capricorn1)

try

CurrentMonth: IIf(Date()=[Due Date],1,0)
  PastDue:IIf(Date() >[Due Date],1,0)
shieldsco

ASKER
Error Message :The expression cannot be used in a calculated table column
Rey Obrero (Capricorn1)

are your table in access db?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
shieldsco

ASKER
yes it's table expression
shieldsco

ASKER
yes Access 2013 table
Rey Obrero (Capricorn1)

you have to do that in a query
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
shieldsco

ASKER
Why not in a table as a calculated column
Rey Obrero (Capricorn1)

so you want to use data macro?
upload a copy of your db
shieldsco

ASKER
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Rey Obrero (Capricorn1)

in the expression to calculate the values for Calculated field, you can only use the fields on the same table and hard coded values,
values such as Date() are not permitted.

another way to achieve the goal is to use DataMacro, see this link for reference
https://msdn.microsoft.com/en-us/library/office/ff973807(v=office.14).aspx
shieldsco

ASKER
Since I have no experience with Data Macros how would the following be created

 CurrentMonth: IIf(Str([Today])=Str([Due Date]),1,0)
  PastDue:IIf([Today]>[Due Date],1,0)
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.