DateDiff

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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
 
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])
 
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!
 
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!
 
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!
 
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]
 
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]
 
Back
Top