Invalid Vertical Bar Error

M

Manoli

I created a query to select Days Difference and I keep getting this vertical
bar error:

Invalid use of vertical bars in query expression
'DateDeff("d"|[date_opened]|[date_closed])& "Days - " &
Format(DateDiff("h"|[date_opened]|[date_closed])Mod 24) & " Hours"'.

I've gotten this error in the past when I try to modify a crosstab from a
Access wizard. Are there any patches or any solutions? I can't modify the
query.
 
M

Manoli

Thanks for the quick response.

I've tried that but I get another error "The expression you entered contains
invalid syntax"

Ken Snell said:
Change the pipe characters ( | ) to commas.

--

Ken Snell
<MS ACCESS MVP>

Manoli said:
I created a query to select Days Difference and I keep getting this
vertical
bar error:

Invalid use of vertical bars in query expression
'DateDeff("d"|[date_opened]|[date_closed])& "Days - " &
Format(DateDiff("h"|[date_opened]|[date_closed])Mod 24) & " Hours"'.

I've gotten this error in the past when I try to modify a crosstab from a
Access wizard. Are there any patches or any solutions? I can't modify the
query.
 
K

Ken Snell [MVP]

Post the entire SQL statement of the query.

--

Ken Snell
<MS ACCESS MVP>

Manoli said:
Thanks for the quick response.

I've tried that but I get another error "The expression you entered
contains
invalid syntax"

Ken Snell said:
Change the pipe characters ( | ) to commas.

--

Ken Snell
<MS ACCESS MVP>

Manoli said:
I created a query to select Days Difference and I keep getting this
vertical
bar error:

Invalid use of vertical bars in query expression
'DateDeff("d"|[date_opened]|[date_closed])& "Days - " &
Format(DateDiff("h"|[date_opened]|[date_closed])Mod 24) & " Hours"'.

I've gotten this error in the past when I try to modify a crosstab from
a
Access wizard. Are there any patches or any solutions? I can't modify
the
query.
 
M

Manoli

It won't allow me to open the query in Design View since it's been saved. The
error appears and it's OK or Help.

Is there an alternative method to get days/hours/minutes difference between
date_opened and date_closed ?

Ken Snell said:
Post the entire SQL statement of the query.

--

Ken Snell
<MS ACCESS MVP>

Manoli said:
Thanks for the quick response.

I've tried that but I get another error "The expression you entered
contains
invalid syntax"

Ken Snell said:
Change the pipe characters ( | ) to commas.

--

Ken Snell
<MS ACCESS MVP>

I created a query to select Days Difference and I keep getting this
vertical
bar error:

Invalid use of vertical bars in query expression
'DateDeff("d"|[date_opened]|[date_closed])& "Days - " &
Format(DateDiff("h"|[date_opened]|[date_closed])Mod 24) & " Hours"'.

I've gotten this error in the past when I try to modify a crosstab from
a
Access wizard. Are there any patches or any solutions? I can't modify
the
query.
 
K

Ken Snell [MVP]

DateDiff function is the common way to get date differences between two date
values.

Your posted "excerpt" is the right format (other than the "DateDeff" typo
and the need to replace | with ,.

--

Ken Snell
<MS ACCESS MVP>

Manoli said:
It won't allow me to open the query in Design View since it's been saved.
The
error appears and it's OK or Help.

Is there an alternative method to get days/hours/minutes difference
between
date_opened and date_closed ?

Ken Snell said:
Post the entire SQL statement of the query.

--

Ken Snell
<MS ACCESS MVP>

Manoli said:
Thanks for the quick response.

I've tried that but I get another error "The expression you entered
contains
invalid syntax"

:

Change the pipe characters ( | ) to commas.

--

Ken Snell
<MS ACCESS MVP>

I created a query to select Days Difference and I keep getting this
vertical
bar error:

Invalid use of vertical bars in query expression
'DateDeff("d"|[date_opened]|[date_closed])& "Days - " &
Format(DateDiff("h"|[date_opened]|[date_closed])Mod 24) & " Hours"'.

I've gotten this error in the past when I try to modify a crosstab
from
a
Access wizard. Are there any patches or any solutions? I can't
modify
the
query.
 
M

Manoli

Thanks for the help. I'll try it again. Not sure, but I think it's an issue
with my software. One of my colleagues was able to do it with his version of
Access and no Vertical Bar error. (I'm running Access 2003 and so is he)

Ken Snell said:
DateDiff function is the common way to get date differences between two date
values.

Your posted "excerpt" is the right format (other than the "DateDeff" typo
and the need to replace | with ,.

--

Ken Snell
<MS ACCESS MVP>

Manoli said:
It won't allow me to open the query in Design View since it's been saved.
The
error appears and it's OK or Help.

Is there an alternative method to get days/hours/minutes difference
between
date_opened and date_closed ?

Ken Snell said:
Post the entire SQL statement of the query.

--

Ken Snell
<MS ACCESS MVP>

Thanks for the quick response.

I've tried that but I get another error "The expression you entered
contains
invalid syntax"

:

Change the pipe characters ( | ) to commas.

--

Ken Snell
<MS ACCESS MVP>

I created a query to select Days Difference and I keep getting this
vertical
bar error:

Invalid use of vertical bars in query expression
'DateDeff("d"|[date_opened]|[date_closed])& "Days - " &
Format(DateDiff("h"|[date_opened]|[date_closed])Mod 24) & " Hours"'.

I've gotten this error in the past when I try to modify a crosstab
from
a
Access wizard. Are there any patches or any solutions? I can't
modify
the
query.
 
D

Dirk Goldgar

Manoli said:
It won't allow me to open the query in Design View since it's been
saved. The error appears and it's OK or Help.

If you really want to get at the SQL of the query, you can probably get
it by entering the following in the Debug window:

?CurrentDb.QueryDefs("YourQueryName").SQL

Substitute the name of your query for YourQueryName in the above
expression. Leave the quotes in.
 
Top