Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Duplicates Records
Message
From
06/03/2004 17:05:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
06/03/2004 13:37:24
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00883809
Message ID:
00883845
Views:
10
>Could you please elaborate. Yes I am only dupplicating for printing purposes. Everytime a new record is added, the system needs to automatically generate two labels for that record.

In this case, it doesn't make sense to have the duplicate records saved permanently.

Let me give you an example. Let's assume the following will create a cursor with all labels for today, but without the desired duplicates:
select FirstName, LastName, CreationTime;
  from MyLabels;
  where ttod(CreationTime) = date();
  order by CreationTime;
  into cursor Temp
This command would be followed by a REPORT FORM command, or a similar command for a label file.

To create the duplicate, you can change this to:
select FirstName, LastName, CreationTime;
    from MyLabels;
    where ttod(CreationTime) = date();
  UNION;
  select FirstName, LastName, CreationTime;
    from MyLabels;
    where ttod(CreationTime) = date();
  order by 3;
  into cursor Temp
UNION will combine the two SELECT parts vertically, duplicating the records. Note that the ORDER BY doesn't accept a field name; this is because the UNION allows to combine fields with different names (but identical sizes). Therefore, you have to use the position instead (field #3 in the example).

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform