QBE – Query By Example Grid – Calculated Field

This post is actually the response to a question I received on one of my videos:

Thanks for the help. question: how can I add a calculated field to speech using your code? I’m new

Video: https://www.youtube.com/watch?v=rtlswEIQYS0&lc=UgxUoxYnDL-DF1t4R2V4AaABAg

I would suggest that you not add a calculated field in your table. Yes, I know Access allows you to do it, but that does not make it right!

Put your calculations in a query, form, report , or code, but not in a “storage tank” like a table.

Here is how to add a simple calculated field to a query:

In a new QBE column type the following:

[Field Name]: [Field1] + [Field2]

Here’s a more complex example in Access:

In the example we are calculating the number of days from the current day until the record is actually due, the actual “Target Date”.

DaysFrodmTarget: DateDiff(“d”,[Target Closure Date],Date())

This shows an example of how to generate your own.

Let me know if you have any questions.

Offsite Related Information:

“Go Fund Me” Page


($5 suggested amount)

(…10% of your gift amount will go to charity)

Free! Subscribe To Our YouTube Channel!

Free MS Access VBA Programming Course

Facebooktwitterredditpinterestlinkedinmailby feather
Tags: , ,