Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VB Variable Zerlegen

Empfohlene Antworten

Veröffentlicht

Hallo,

ich will in VB eine Variable in 2 teile Zerlegen und zwar eine Jahres angabe im Format JJJJMMM (z.b. 2002008 ist August).

Als erbegnis will ich dann einmal eine neu Variable nur mit Jahr(2002) und eine nur mit dem Monat(008). Gibt es eine Funktion dafür??

Gruß

T-B

Du kannst mit der Split-Funktion Strings trennen. Dafür einmal das Datum mit CStr(Variable) umwandeln, mit Split an der entsprechenden Stelle "durchschneiden", und wenn du es dann brauchst, dann kannst du das ganze noch in einen Longwert mit Clng(Variable) umwandeln...

HI,

Du kannst nach dem Umwandeln mit CStr(), aber auch die Funktion MID() benutzen. Nur so als Alternative.

Gruß, Tia

Es gibt auch noch Funktionen wie Right() und Left().

JayN

Die Right und Left funktion war genau die, die ich suchte.:D

Danke!!!

wenn die Variable ein Datum enthält kann man die sachen auch mit der Format Funktion rausbekommen.

dazu muss die Variable so aussehen:

strDate= "20020802"

es muss auch jedenfall ein Datum sein

strJahr = Format(strDate,"yyyy")

strTag = Format(strDate,"dd")

strMonat = Format(strDate,"mm")

Gruß

Guido

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.