|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL-Mathematical function
Hi - hopefully this is an easy query for any experts out there! Suppose I want to know the cust_name & order_no with invoice date > 30 days & 60 days old from the date of invoice, how do I query against a Microsoft Access table via vb6.0 shown on a data report. Table: The result should show as below: Customer name Order No > 30 DYS > 60 DYS Total A A0001 4000 4000 B B0001 5000 5000 ---------------------------------------- 4000 5000 9000 ======================== can anyone help? Thanks From ebbie |
|
#2
|
||||
|
||||
|
Use the DateAdd function
Code:
30 days
SELECT * FROM TableName WHERE InvoiceDate >= DateAdd("d", 30, InvoiceDate) As '30 Days'
60 days
SELECT * FROM TableName WHERE InvoiceDate >= DateAdd("d", 60, InvoiceDate) As '60 Days'
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > SQL-Mathematical function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|