Solved

Pullinh out information from a database

Posted on 2004-04-17
3
132 Views
Last Modified: 2010-04-06
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.



0
Comment
Question by:eteran
  • 2
3 Comments
 

Author Comment

by:eteran
Comment Utility
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
0
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 500 total points
Comment Utility
Looks good... It should work..
0
 
LVL 12

Expert Comment

by:venkateshwarr
Comment Utility
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
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now