DateDiff

C

Candace

I am trying to use the date difference function. I the database I am pulling
from have multiple tables with the same naming conventions. I am a fairly
novice user and am trying to figure some functions out to make my job easier.
I can’t seem to enter the table names correctly so I can figure out the
function.... here is what I am where I started.

DateDiff(“nâ€,[0396IA_VCSESUM.REC_INS_TS],[0396IA_VCSESUM.CSE_CLO_TS],â€0â€,[0396IA_VCSESUM.REC_INS_TS])

I am trying to find the difference between to timestamp field to calculate
the total time a record was opened. Access keeps telling me I'm using
incorrect bracketing. Please Help!
 
J

Jeff Boyce

Candace

Take a look at Access HELP for the DateDiff() function. Your expression
looks like you are trying to mix DateDiff() and IIF().

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

KARL DEWEY

You also have other syntax wrong. You can difference two dates but you have
more than two fields. Also why do you have a zero in quotes?

Use this --
DateDiff(“nâ€,[0396IA_VCSESUM].[REC_INS_TS],[0396IA_VCSESUM].[CSE_CLO_TS])
 
C

Candace

Thank you for the help. I tried the formula you provided and it prompts me to
enter the parameters for 0396IA_VCSESUM.REC_INS_TS? I double checked and it
is the correct table and field name....

KARL DEWEY said:
You also have other syntax wrong. You can difference two dates but you have
more than two fields. Also why do you have a zero in quotes?

Use this --
DateDiff(“nâ€,[0396IA_VCSESUM].[REC_INS_TS],[0396IA_VCSESUM].[CSE_CLO_TS])

--
KARL DEWEY
Build a little - Test a little


Candace said:
I am trying to use the date difference function. I the database I am pulling
from have multiple tables with the same naming conventions. I am a fairly
novice user and am trying to figure some functions out to make my job easier.
I can’t seem to enter the table names correctly so I can figure out the
function.... here is what I am where I started.

DateDiff(“nâ€,[0396IA_VCSESUM.REC_INS_TS],[0396IA_VCSESUM.CSE_CLO_TS],â€0â€,[0396IA_VCSESUM.REC_INS_TS])

I am trying to find the difference between to timestamp field to calculate
the total time a record was opened. Access keeps telling me I'm using
incorrect bracketing. Please Help!
 
J

Jeff Boyce

Candace

If Access prompts you, it's because Access can't find an object spelled
EXACTLY that way. Have you tried copying and pasting, rather than
re-typing?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Candace said:
Thank you for the help. I tried the formula you provided and it prompts me
to
enter the parameters for 0396IA_VCSESUM.REC_INS_TS? I double checked and
it
is the correct table and field name....

KARL DEWEY said:
You also have other syntax wrong. You can difference two dates but you
have
more than two fields. Also why do you have a zero in quotes?

Use this --
DateDiff("n",[0396IA_VCSESUM].[REC_INS_TS],[0396IA_VCSESUM].[CSE_CLO_TS])

--
KARL DEWEY
Build a little - Test a little


Candace said:
I am trying to use the date difference function. I the database I am
pulling
from have multiple tables with the same naming conventions. I am a
fairly
novice user and am trying to figure some functions out to make my job
easier.
I can't seem to enter the table names correctly so I can figure out the
function.... here is what I am where I started.

DateDiff("n",[0396IA_VCSESUM.REC_INS_TS],[0396IA_VCSESUM.CSE_CLO_TS],"0",[0396IA_VCSESUM.REC_INS_TS])

I am trying to find the difference between to timestamp field to
calculate
the total time a record was opened. Access keeps telling me I'm using
incorrect bracketing. Please Help!
 
K

KARL DEWEY

Check your typing!
What you posted back ends with a question mark that was not what I posted.

Where are you using this?

--
KARL DEWEY
Build a little - Test a little


Candace said:
Thank you for the help. I tried the formula you provided and it prompts me to
enter the parameters for 0396IA_VCSESUM.REC_INS_TS? I double checked and it
is the correct table and field name....

KARL DEWEY said:
You also have other syntax wrong. You can difference two dates but you have
more than two fields. Also why do you have a zero in quotes?

Use this --
DateDiff(“nâ€,[0396IA_VCSESUM].[REC_INS_TS],[0396IA_VCSESUM].[CSE_CLO_TS])

--
KARL DEWEY
Build a little - Test a little


Candace said:
I am trying to use the date difference function. I the database I am pulling
from have multiple tables with the same naming conventions. I am a fairly
novice user and am trying to figure some functions out to make my job easier.
I can’t seem to enter the table names correctly so I can figure out the
function.... here is what I am where I started.

DateDiff(“nâ€,[0396IA_VCSESUM.REC_INS_TS],[0396IA_VCSESUM.CSE_CLO_TS],â€0â€,[0396IA_VCSESUM.REC_INS_TS])

I am trying to find the difference between to timestamp field to calculate
the total time a record was opened. Access keeps telling me I'm using
incorrect bracketing. Please Help!
 
J

John W. Vinson

I am trying to use the date difference function. I the database I am pulling
from have multiple tables with the same naming conventions. I am a fairly
novice user and am trying to figure some functions out to make my job easier.
I can’t seem to enter the table names correctly so I can figure out the
function.... here is what I am where I started.

DateDiff(“n”,[0396IA_VCSESUM.REC_INS_TS],[0396IA_VCSESUM.CSE_CLO_TS],”0”,[0396IA_VCSESUM.REC_INS_TS])

I am trying to find the difference between to timestamp field to calculate
the total time a record was opened. Access keeps telling me I'm using
incorrect bracketing. Please Help!

What are these fields? DateDiff() takes *three* arguments: the timestep ("n")
and two Date/Time values. You're also passing a text string "0" and a third
field.

What is the data in the fields? What value do you want returned?

John W. Vinson [MVP]
 
J

John W. Vinson

Thank you for the help. I tried the formula you provided and it prompts me to
enter the parameters for 0396IA_VCSESUM.REC_INS_TS? I double checked and it
is the correct table and field name....

Is that table, and that field, included in the Query? You can't just pull in
the table 0396IA_VCSESUM from left field; it needs to be included in the
query. Perhaps you could post the complete SQL statement of your query.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Weekly Report 2
Trying to create a report that will list unmatched records by Ticket Primary Key 0
DateDiff 3
DateDiff calculation 2
Can't query DateDiff 0
New to DateDiff Function 1
DateDiff function 3
DateDiff 4

Top