Utilisation de Char pour comparer des valeurs numériques et des caractèresSalut,
Est-il possible de comparer des valeurs numériques et des caractères ?
Je veux comparer deux colonnes (valeurs identiques ou différentes). Une colonne a une date numérique et une a une date de caractère et comme je n'ai besoin de comparer que des parties de celle-ci, je veux utiliser une sous-chaîne. Le script ci-dessous s'exécute, mais il ne me donne pas le bon résultat car tout semble différent (ce qui n'est pas le cas). Est-ce que j'utilise mal Char?
If( Substr( Char( :Name( "Date/Time of Specimen Collection" ) ), 1, 10 ) == Substr( :Name( "Start Date/Time of Visit" ), 1, 10 ),
"identical",
"different"
)
Je sais que je peux changer le format de "Date/Heure de la collecte des échantillons" mais je préfère ne pas le faire car cela compliquera d'autres parties de mon script.
Merci d'avance
ScriptRe : Utiliser Char pour comparer des valeurs numériques et des caractèresPour comprendre ce qui se passe, créez une colonne temporaire avec
Char( :Name( "Date/Time of Specimen Collection" ) )
comme formule. Vous devrez probablement utiliser la fonction format(...) (au lieu de char(...)) pour spécifier le format date-heure exact dont vous avez besoin pour obtenir toutes les valeurs et tous les caractères de séparation corrects. Vous pouvez voir les noms de format disponibles lorsque vous utilisez la boîte de dialogue des propriétés de colonne et regardez la section format... date.
Re : Utiliser Char pour comparer des valeurs numériques et des caractèresJe vois ce que tu veux dire. Je n'arrive pas à le faire correctement en utilisant le format.
Est-il possible de le faire sans créer de colonnes supplémentaires ?
Re : Utiliser Char pour comparer des valeurs numériques et des caractèresOui. Quel est le format du caractère date ?
Re : Utiliser Char pour comparer des valeurs numériques et des caractèresDans l'extrait de tableau ci-joint, j'essaie de comparer la partie date de la colonne "Date/heure de la collecte des échantillons" (numérique, aaa-mm-jjThh:mm:ss) avec la colonne "Date/heure de début de la visite" (caractère , nominal)
Existe-t-il une fonction permettant à jmp de voir les valeurs numériques sous forme de caractères (formatés en tant que date bien sûr) afin que je puisse utiliser une sous-chaîne pour la partie date de celle-ci?
Re : Utiliser Char pour comparer des valeurs numériques et des caractères
Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Using the format() function; the numeric date is in year-month-day for 7 February; the character format is in day/month/year.Utilisation de la fonction format() ; la date numérique est en année-mois-jour pour le 7 février ; le format des caractères est en jour/mois/année.
Re : Utiliser Char pour comparer des valeurs numériques et des caractèresVous pourriez avoir besoin de ce format :
the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.the T format is an ISO standard.le format T est une norme ISO.
Re : Utiliser Char pour comparer des valeurs numériques et des caractèresOu même ceci :
You don't need substr for the yyy-mm-dd format; it already returns just the 10 characters you need.You don't need substr for the yyy-mm-dd format; it already returns just the 10 characters you need.You don't need substr for the yyy-mm-dd format; it already returns just the 10 characters you need.You don't need substr for the yyy-mm-dd format; it already returns just the 10 characters you need.You don't need substr for the yyy-mm-dd format; it already returns just the 10 characters you need.You don't need substr for the yyy-mm-dd format; it already returns just the 10 characters you need.You don't need substr for the yyy-mm-dd format; it already returns just the 10 characters you need.You don't need substr for the yyy-mm-dd format; it already returns just the 10 characters you need.Vous n'avez pas besoin de substr pour le format aaa-mm-jj ; il ne renvoie déjà que les 10 caractères dont vous avez besoin.
Re : Utiliser Char pour comparer des valeurs numériques et des caractèresMerci beaucoup - je vais tenter le coup 