Bienvenidos al Chivolero

En este espacio están algunos ejemplos sobre algunos temas básicos y muy importanes en la programación.

Este espacio es exclusivo para personas que sepan y que no solamente sepan el famoso 'copy/paste'

martes, 17 de junio de 2008

Varios

Fecha:
Insert
Values ('AA-MM-DD')

Select *
From Tabla
Where X IN (a,c,e)

select *
From alumnos
where apellidos like 'a%m'

Select*,Ventas,Meta
from Ingresos
Where ventas>=Objetivo

Select *
From Alumnos
Where X Not ('1990-01-13')

1 comentario:

Hdrake11 dijo...

Public Class Form1
Dim a, b, c, d As Integer
Dim bis, mes, mes2, dia As Integer
Function fecha(ByVal a As Integer, ByVal b As Integer, ByVal c As Integer) As Integer
bis = 0
mes = 0
mes2 = 0
dia = 0
If (c Mod 4 = 0) And (c Mod 100 = 0) And (c Mod 400 = 0) Then
bis = 1
End If
If (b > 12) Or (b < 1) Then
mes = 1
End If
If b = 1 Or b = 3 Or b = 5 Or b = 7 Or b = 8 Or b = 10 Or b = 12 Then
mes2 = 1
End If
If mes2 = 1 Then
If a > 31 Or a < 1 Then
dia = 1
End If
Else
If a > 30 Or a < 1 Then
dia = 1
End If
End If
If b = 2 Then
If bis = 0 Then
If a > 28 Or a < 1 Then
dia = 1
End If
Else
If a > 29 Or a < 1 Then
dia = 1
End If
End If
End If
If dia = 0 And mes = 0 Then
Return 1
End If
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
a = TextBox1.Text
b = TextBox2.Text
c = TextBox3.Text
d = fecha(a, b, c)
If d = 1 Then
Label4.Text = "Su Fecha es: Correcta"
Else
Label4.Text = "Su Fecha es: Incorrecta"
End If
End Sub
End Class