Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Isolating Part of a Date Field Post Reply Post New Topic
Author Message
bjfils
Newbie
Newbie


Joined: 03 Apr 2016
Online Status: Offline
Posts: 33
Quote bjfils Replybullet Topic: Isolating Part of a Date Field
     Posted: 30 Sep 2024 at 4:22am
I have a need to compare values in a table, but only report on those where a part of the data is a mismatch. The data in the field in question would be in the format of 010-4XXXX-8XX. This is for properly recording the general ledger account number for invoices. I'm only interested in instances when the 8 in this field isn't the same in all line items for each invoice number. There will be cases where some of the entries for the invoice have an 8 there and other entries for the same invoice will have a 6 there. The rest of the digits in the field are irrelevant. I only need to report on those where there's a 6 and an 8. All sixes or all eights are correct. There will be at least two, and maybe more, line items in the table. The constant in the table is the invoice number.

No clue how to query for this. Any suggestions? Thanks,
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Jun 2025 at 8:15am
Long past the ask.

I would have used mid({field}, 11, 1) = 8 or 6.
Would have made the mid({field}, 11, 1) a local variable as I hate typing.

Just a thought
IP IP Logged
bjfils
Newbie
Newbie


Joined: 03 Apr 2016
Online Status: Offline
Posts: 33
Quote bjfils Replybullet Posted: 30 Jun 2025 at 4:07am
Thanks. The issue that gave rise to my question ended in December, but could come up again. I'll be sure to remember this!
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum