Link to home
Start Free TrialLog in
Avatar of eteran
eteranFlag for United States of America

asked on

Pullinh out information from a database

OKay, GOt a table in which dates are stored .

This are all the columns and their names:

 Date     Date01     Date02      Date03      Date04      Date05      Date06      Date07      Date08      Date09      Date10
Date11  Date12     Date13      Date14

What I am trying to do isw have an sql statement that runs threw each column to see what is due in 3 days from the date the report is pulled.

Also I have another table named T_employee in which I need to match the agents_ID to pull the phone number and Name out.



Avatar of eteran
eteran
Flag of United States of America image

ASKER

Will a querry like this work in MYSQL statement

SELECT T_Transaction.Agent_ID, T_Transaction.Transaction_ID, T_Transaction.Transaction_Name, T_Transaction.Address, T_Transaction.[Apt:], T_Transaction.City, T_Transaction.State, T_Transaction.Status, T_Transaction.Totalamount, T_Transaction.Totalcommison, T_Transaction.Date14, Month([date14]) AS Expr1, Year([Date14]) AS Expr2, [totalcommison]-([commision_split]*[totalcommison]) AS Expr3, T_Employees.Cell_Number, T_Employees.First_Name, ([commision_split]*[totalcommison]) AS Expr4, T_Transaction.Type
FROM T_Employees INNER JOIN T_Transaction ON T_Employees.[Employment_ ID] = T_Transaction.Agent_ID
ASKER CERTIFIED SOLUTION
Avatar of venkateshwarr
venkateshwarr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of venkateshwarr
venkateshwarr

The problem is with your date... Month() and Year() parts
the query may not work in all the databases
In some databases DatePart function may work