Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Duplicates Records
Message
De
06/03/2004 17:05:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
06/03/2004 13:37:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00883809
Message ID:
00883845
Vues:
11
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform