Access - antiguedad

 
Vista:

antiguedad

Publicado por Analia (19 intervenciones) el 11/05/2004 20:51:48
Hola soy Analia y tengo 19años. mi pregunta es como puedo calcular la antiguedad de una fecha en una tabla, para que me arroje los años meses y dias?
muchas gracias ..
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:antiguedad

Publicado por Jesus (861 intervenciones) el 12/05/2004 03:29:12
Algo así:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Function strGetTableDesc(strTable As String) As String
On Error Resume Next
'Purpose: Get the description for a linked table from the B/E DB.
'Some Info: I used the 'msysobjects' table to grab the path to the B/E db and also to grab the
'name of the foreign table name. Just in case a different name is used for the linked table name.
Dim strDesc As String
Dim db As Database
Dim strDb As String
Dim strForeignTblName As String
strDb = DLookup("Database", "msysobjects", "Name=" & Chr(34) & strTable & Chr(34)) 'Path to B/E DB
strForeignTblName = DLookup("ForeignName", "msysobjects", "Name=" & Chr(34) & strTable & Chr(34)) Name of table in External DB
If Len(strDb) = 0 Then 'Local table.
   Set db = currentdb
    strDesc = db.TableDefs(strTable).Properties("Description").value
Else
    Set db = DBEngine.OpenDatabase(strDb) 'Linked Table
    strDesc = db.TableDefs(strForeignTblName).Properties("Description").value 'Linked Tables
End If
strGetTableDesc = strDesc
If Not db Is Nothing Then Set db = Nothing
End Function
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar