lundi 7 décembre 2015

No such column though table has that column

This is my table:

/* Column information for - tblPersonalInfo */
----------------------------------------------

cid      name             type        notnull      dflt_value      pk   
------- --------------- ---------- ----------- -------------- --- 
0        userID           INTEGER     0                            1    
1        firstName        TEXT        0                            0    
2        middleName       TEXT        0                            0    
3        lastName         TEXT        0                            0    
4        nameSuffix       TEXT        0                            0    
5        birthday         DATE        0                            0    
6        sex              INTEGER     0                            0    
7        height_foot      INTEGER     0                            0    
8        height_inch      INTEGER     0                            0    
9        weight           REAL        0                            0    
10       civilStatus      INTEGER     0                            0    
11       contactNo        TEXT        0                            0    
12       emailAddress     TEXT        0                            0    
13       address_city     TEXT        0                            0    
14       address_brgy     TEXT        0                            0    
15       photo            BLOB        0                            0    

I want to execute this query to get the Age of an Employee in tblPersonalInfo table:

SELECT CAST(STRFTIME('%Y.%m%d', 'NOW') - STRFTIME('%Y.%m%d', birthday) AS INT) AS Age
FROM tblPersonalInfo

I emulate that query/formula from SQLite: How to calculate age from birth date but SQLite gives me an error message that says:

Error: No such column: birthday

Advanced thanks to our experts here in StackOverflow community.

Aucun commentaire:

Enregistrer un commentaire