concatenate records

J

Jen

Hi everyone,

I'm trying to concatenate records created by the same user for the same
customer on the same day at the same time (working with AS400 & each line on
a comment form is its own record). Here is what i have right now.

Comment: Concatenate("Select Trim([Comment]) from qryCommentsV2 where
userid=""" & [userid] & """ and [cust#]=" & [Cust#] & " and Time=" & [Time]
And [date]="&format([date],"\#m/d/yyyy\#")")

I also tried taking out the # and using ' instead, but I still get the error.

Thank you!!

It works without the date section but when I add on the date section I get
an #error.
 
D

Duane Hookom

Try the following being careful about line wrapping. This assumes the [time]
field is a date/time data type.

Comment: Concatenate("Select Trim([Comment]) from qryCommentsV2 where
userid=""" & [userid] & """ and [cust#]=" & [Cust#] & " and [Time]=#" &
[Time] & "# And [date]=#" & format([date],"m/d/yyyy") & "#")
 
J

Jen

Hi Duane - thanks for the super fast response!

The time field is actually a number (not my idea) but this worked perfect!

Thank you so much!

Duane Hookom said:
Try the following being careful about line wrapping. This assumes the [time]
field is a date/time data type.

Comment: Concatenate("Select Trim([Comment]) from qryCommentsV2 where
userid=""" & [userid] & """ and [cust#]=" & [Cust#] & " and [Time]=#" &
[Time] & "# And [date]=#" & format([date],"m/d/yyyy") & "#")
--
Duane Hookom
Microsoft Access MVP


Jen said:
Hi everyone,

I'm trying to concatenate records created by the same user for the same
customer on the same day at the same time (working with AS400 & each line on
a comment form is its own record). Here is what i have right now.

Comment: Concatenate("Select Trim([Comment]) from qryCommentsV2 where
userid=""" & [userid] & """ and [cust#]=" & [Cust#] & " and Time=" & [Time]
And [date]="&format([date],"\#m/d/yyyy\#")")

I also tried taking out the # and using ' instead, but I still get the error.

Thank you!!

It works without the date section but when I add on the date section I get
an #error.
 

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

Top